Jump to content

move to next page


shirvo

Recommended Posts

This is really simple i'm sure but i dont know how to do it.
this is the code.

once it has logged in the user i want it to move to a different page automaticly and have querystings attached to it. below i will mark where i want the code to go.

<html>
<head>
<title>Login</title>
</head>
<body>
<center>
<table>
<form method=post action=login.php>
<p>Enter username and password to login</p>
<p>User Name <input type=text name=user_name></p>
<p>Password <input type=password name=password></p>
<center>
<input type=submit value="Login">
</center>
</form>
<?
include 'connect.php';
$user_name = $_POST['user_name'];
$password = $_POST['password'];


if ($user_name == "" or $password == "")
;
else
{
$sql_query = mysql_query("SELECT password FROM user_data WHERE user_name='$user_name'",$db);
$rs = mysql_fetch_row($sql_query);
if($password != $rs[0])
echo "ERROR: Invalid User";
else
[color=red]echo "You are logged in";[/color]
}

?>
</table>
</body>
</html>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.