hisham
IS-IT--Management
- Nov 6, 2000
- 194
In my local server I use PHP Version 4.2.1, register_globals is set to on,
when I try to run the following code:
index.html:
<form action="login.php" method="post">
<input type="text" name="username>
<input type="password" name="password">
<input type="submit" value="Login">
</form>
php code:
<?
session_start();
// connection goes here,
$query = mysql_query("SELECT COUNT(*) AS counter FROM admin WHERE username='$username' AND password='$password'"
or die(mysql_error());
$row = mysql_fetch_array($query);
if ($row["counter"] == 1) {
$login = $username;
session_register('login');
include("navigation.php"
;
exit;
} else {
include "index.php";
}
?>
it runs well when I use it in my Linux box , but when I connect to this sever using windows from other machine in the LAN it was run good, for some reasons now just refresh the page when the submit button is clicked. all the other php codes run without problems.
Thanks in advance for any help..
when I try to run the following code:
index.html:
<form action="login.php" method="post">
<input type="text" name="username>
<input type="password" name="password">
<input type="submit" value="Login">
</form>
php code:
<?
session_start();
// connection goes here,
$query = mysql_query("SELECT COUNT(*) AS counter FROM admin WHERE username='$username' AND password='$password'"

$row = mysql_fetch_array($query);
if ($row["counter"] == 1) {
$login = $username;
session_register('login');
include("navigation.php"

exit;
} else {
include "index.php";
}
?>
it runs well when I use it in my Linux box , but when I connect to this sever using windows from other machine in the LAN it was run good, for some reasons now just refresh the page when the submit button is clicked. all the other php codes run without problems.
Thanks in advance for any help..