hi all,
I had a page.It works fine in mozilla.But i am getting problem with Internet Explorer.
The problem is...In my page i can add users and they can be seen in a table on the same page.so this is fine with mozilla,but in IE i can see the existing users but after i add a user, i cannot see him in the table.and parallel to that if open mozilla i can see him in that. so wat makes different.. can any one please....

Recommended Answers

All 8 Replies

Are you using javascript to add the new one to the table? If so, then check your js code.

no iam using for the entire page only php and HTML

Member Avatar for diafol

It's the third line after the open php tag that's causing the problem. You've also incorrectly named the $id variable on line 58.

It's the third line after the open php tag that's causing the problem. You've also incorrectly named the $id variable on line 58.

Are you psychic ? Or just seeing something I don't ...

I changed my mind about this stupid post, so I click edit/delete. So where the heck is the option to delete?!?!?

Needless to say, I'm giving up in frustration as I can find no option to delete, and every time I delete all the text, the editor tells me there's not enough text in the post. Is a simple readily visible delete button too much to ask for?

Member Avatar for diafol

>Are you psychic ? Or just seeing something I don't ...

The OP assumes we're all psychic by not showing his code. I'm just letting him know that I am the real deal and can see his code from here.

He's also wearing pink underpants and is now looking at the screen in awe as he sees my post.

Now niths, you're pondering whether to post the code or not. Decisions, decisions.
Well, I'm gonna post this now. Love to see your face when you read this. Great, aren't I?

Hi ardav,
Ok,thats my mistake.But this is not the way to say to post code. k any way that is ur manners..

<?php
ob_start();
@session_start();
require_once ("check.php");
include 'connection.php';
$query= mysql_query("SELECT * FROM users where reportingto='$_SESSION[username]' and role='2'");
mysql_error();
$num=mysql_num_rows($query);

 ?>
 <head>

 <meta http-equiv="refresh" content="4">
 <link rel="stylesheet" type="text/css" href="style.css"/>
 <script language="javascript" type="text/javascript" src="back.js" ></script>
 <body onLoad="backButtonOverride()">
 <table>
<tr><td> <img src="Logofinalcopy.gif">
</td></tr>
    </table><br><hr style="color: red;">
    <table align="right"> 
    <tr> <td></td>
        <td align="right" style="color: navy;"><strong><?php echo "Welcome ".$_SESSION[username];?>,</strong></td><td><a href="logout.php">Logout</a></td>
         <td align="right" style="width: 50px">   
         </td>
        </tr></table>
        <table><tr>
        <td><a href="Admin.php">Home</a></td>
        <td>&nbsp&nbsp&nbsp&nbsp 
        <a href="Projectmgmt.php">Projects</a></td>
        <td>&nbsp&nbsp&nbsp&nbsp<a href="projectassign.php">Project Assign</a></td>
        </tr>
        </table>
        <table align="center" >
        <tr><td style="width: 50px"></td>
        
    </tr>
</table>
	<table>
	<tr>			
		
		<td  align="right" style="width: 1000px">&nbsp;</td>
		
		<td  align="left" style="width: 177px"><a href="Admin.php" onclick="window.open('http://10.70.2.142/Project/usercreation1.php','popup','width=400,height=250,scrollbars=no,resizable=no,toolbar=no,directories=no,location=center,menubar=no,status=no,left=370,center=0,top=300')">Add Users</a></td>
		
	</tr>
</table>        
<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 500px" bordercolor="red">
	<tr>
		<th style="color: navy;">Userid</th>
		<th style="color: navy;">Username</th>
		<th style="color: navy;">Password</th>
		<th style="color: navy;">Role</th>
		<th style="color: navy;">Status</th>   
	</tr>
<?php
$i=0;
while ($i < $num){
$f1=mysql_result($query,$i,"userid");
$f2=mysql_result($query,$i,"username");
$f3=mysql_result($query,$i,"password");
$f4=mysql_result($query,$i,"role");
if($f4 == 0)
   $f4 = 'Super Admin';
elseif($f4== 1)
   $f4 = 'Admin';
else
   $f4= 'User';   
$f5=mysql_result($query,$i,"status");
if($f5 == 1)
   $f5 = 'Active';
else
   $f5 = 'Inactive';

   ?>   
 <tr>
    
	<td><?php echo $f1;?></td>
	<td><?php echo $f2; ?></td>
	<td><?php echo $f3; ?></td>
	<td><?php echo $f4; ?></td>
	<td><?php echo $f5; ?></td>
    
	<td><a href =http://10.70.2.142/Project/Admin.php onclick="window.open('http://10.70.2.142/Project/update1.php?f1=<?php echo $f1;?>','popup','width=400,height=250,scrollbars=no,resizable=no,toolbar=no,directories=no,location=center,menubar=no,status=no,left=370,center=0,top=300')">
    edit</a></td>
    <!--<td><input type="button" value="Edit" onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'screen-center',0,0);" ></td> -->
</tr>
<?php
$i++;
}
?>
</table>
</body>
</head>
<?php
ob_start();
    if($_SESSION['username']=="")
    {
@header('location: http://localhost/Project/login.php');
    ob_end_flush();

    }

?>

On line 44 i can add users. and in line 84 i can edit them.

wen i click on addusers i wil hav a popup and that addusercode is here

<html>

<script language="javascript" type="text/javascript">
		function check()
		{
			if(document.getElementById('txtusrid').value == "")
			{
				alert('Please enter Username');
				return false;
				
			}
			if(document.getElementById('txtpwd').value == "")
			{
				alert('Please enter password');
				return false;
			}
            if(document.getElementById('txtrep').value == "")
            {
                alert('Please enter reportingto');
                return false;
            }
           
		}
        function setFocus()
        {
            var field = document.f1.username;
            field.focus();
            field.value = field.value;
            field.focus();
        }
	</script>
 <body onload="setFocus()">
<form action="usercreation1.php" method="post" name="f1">
<table align="center">
    
    <tr>
        <td style="color: navy;">Username</td>
        <td><input id="txtusrid" type="text" name="username"></td>
    </tr>
    <tr>
        <td style="color: navy;">Password</td>
        <td><input id="txtpwd" type="password" name="password"></td>
    </tr>
   <!-- <tr>
        <td style="color: navy;">Role</td>
        <td><select name="role">
        
        <option value="User" selected="selected">User</option>
        </select>
       </td>
    </tr>-->
    
    <!--<tr>
        <td style="color: navy;">Status:</td>
        <td><select name="status">
        
        <option value="Active" selected="selected">Active</option>
        </select>
       </td>
    </tr>-->
     
    <tr>
        <td></td>
        <td><input type="submit" name="btn" value="Submit" onclick="return check();"></td>
</table>
</form>
</body>
</html>


<?php
if(isset($_POST['btn']))
{
$id=$_GET['f1'];
@session_start();
require_once ("check.php");
$con=mysql_connect("10.70.1.89","invensis","invensis");
if(!$con)
    {
        die('Could not connect: ' . mysql_error());
    }
mysql_select_db("database_myproject",$con);
if($_POST[role]== 'Super Admin')
    $_POST[role]= 0;
elseif($_POST[role]== 'Admin')
    $_POST[role]=1;
else
    $_POST[role]=2;
    

if($_POST[status] == 'Active')
   $_POST[status] = 1;
else
   $_POST[status] = 0;
   $pname=$_POST['username']; 
$query="select username from users where username='$pname'";
mysql_error();  
$result=mysql_query($query);
$count=mysql_num_rows($result);
if($count==0)
{
$sql="INSERT INTO users(username, password, role, status, allocatedmemory, reportingto)
VALUES ('$_POST[username]', '$_POST[password]','2','1','$_POST[allocatedmemory] $_POST[size]','$_SESSION[username]')";
echo "<script language='javascript'>
            alert('New User added');
           </script>";
echo "<script language='javascript' type='text/javascript'>
window.close();
</script>";
if(!mysql_query($sql,$con))
 {
     die('Error:' . mysql_error());
 }
}
else{
 echo "<script language='javascript'>
            alert('Username already exists');
           </script>";
    }
} 
?>
Member Avatar for diafol

niths - chill - bit of friendly banter.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.