Jump to content

Works in Firefox but not IE.


Mr P!nk

Recommended Posts

<?php
include('includes/db_inc.php');

if(isset($submit)) // name of submit button
{
    $sql = "SELECT * FROM merc_users WHERE username='$username' AND password='$password'";
    $result = mysql_query($sql);
    $isAuth = false;
    
    
    while ($row = mysql_fetch_array($result)) {
        if($row['username'] == $username)
        
        {
            $isAuth = true;
            @session_start();
            session_register('username');
        }
        
    }
    
}
?>
</head>

<body topmargin="0" leftmargin="0">
<table width="800" height="489" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="19%" rowspan="3" bgcolor="#B7CA33" scope="col"><img src="images/global_nav_bg.gif" width="152" height="600" hspace="0" vspace="0" /></td>
<th width="81%" height="56" nowrap="nowrap" scope="col"><div id="Layer4"><img src="login/images/login_header.gif" width="648" height="316" /></div></th>
</tr>
<tr>
<td height="80"><p> 
</p>
<p> 
</p>
<p> 
</p></td>
</tr>
<tr>
<td height="79"><form action="index.php" method="post" enctype="multipart/form-data">
<p>
<?php

if ($isAuth && isset($submit)) {
    printf("<div id=\"system\" align=\"center\">You have logged in successfully. <a href=\"layout.php\">Go to Layout selection</a></div>");
}

else if (!$isAuth && isset($submit)) {
    printf("<div id=\"system\" align=\"center\">Login unsuccessful. Check your details and <a href=\"index.php\">try again</a></div>");
}

if (!isset($submit)) {
    
    echo("<table width=\"33%\" height=\"101\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"2\">
<tr>
<td height=\"58\" scope=\"col\"><p align=\"center\">Username
<input name=\"username\" type=\"text\" class=\"loginText\" id=\"username\" size=\"15\" maxlength=\"15\" />
<br />
<br />
Password
<input name=\"password\" type=\"password\" class=\"loginText\" id=\"password\" size=\"15\" maxlength=\"15\" />
</p></td>
</tr>
<tr>
<td scope=\"col\"><div align=\"center\" ><input type=\"image\" src=\"login/images/login_btn.gif\" alt=\"Submit\" name=\"submit\" type=\"submit\" id=\"submit\" value=\"login\"></div></td>
</tr>
</table>" 
}
?>

 

does anyone know why this works perfectly in Firefox, But in IE it just reloads the index.php when submit is clicked?

 

thanks

 

P!nk

Link to comment
https://forums.phpfreaks.com/topic/71692-works-in-firefox-but-not-ie/
Share on other sites

probably the pesky global reg's..

 

<?php
include('includes/db_inc.php');

if(isset($_POST['submit'])) // name of submit button
{
//Need to filter this..........
$username = $_POST['username'];
$password = $_POST['password'];
//SQL injection detected here.. Filter the above

    $sql = "SELECT * FROM merc_users WHERE username='$username' AND password='$password'";
    $result = mysql_query($sql);
    $isAuth = false;
    
    
    while ($row = mysql_fetch_array($result)) {
        if($row['username'] == $username)
        
        {
            $isAuth = true;
            @session_start();
            session_register('username');
        }
        
    }
    
}
?>
</head>

<body topmargin="0" leftmargin="0">
<table width="800" height="489" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="19%" rowspan="3" bgcolor="#B7CA33" scope="col"><img src="images/global_nav_bg.gif" width="152" height="600" hspace="0" vspace="0" /></td>
<th width="81%" height="56" nowrap="nowrap" scope="col"><div id="Layer4"><img src="login/images/login_header.gif" width="648" height="316" /></div></th>
</tr>
<tr>
<td height="80"><p> 
</p>
<p> 
</p>
<p> 
</p></td>
</tr>
<tr>
<td height="79"><form action="index.php" method="post" enctype="multipart/form-data">
<p>
<?php

if ($isAuth && isset($_POST['submit'])) {
    printf("<div id=\"system\" align=\"center\">You have logged in successfully. <a href=\"layout.php\">Go to Layout selection</a></div>");
}

else if (!$isAuth && isset($_POST['submit'])) {
    printf("<div id=\"system\" align=\"center\">Login unsuccessful. Check your details and <a href=\"index.php\">try again</a></div>");
}


if (!isset($_POST['submit'])) {
    
    echo("<table width=\"33%\" height=\"101\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"2\">
<tr>
<td height=\"58\" scope=\"col\"><p align=\"center\">Username
<input name=\"username\" type=\"text\" class=\"loginText\" size=\"15\" maxlength=\"15\" />
<br />
<br />
Password
<input name=\"password\" type=\"password\" class=\"loginText\" size=\"15\" maxlength=\"15\" />
</p></td>
</tr>
<tr>
<td scope=\"col\"><div align=\"center\" ><input type=\"image\" src=\"login/images/login_btn.gif\" alt=\"Submit\" name=\"submit\" type=\"submit\" value=\"login\"></div></td>
</tr>
</table>" 
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.