Can someone help-here with this script i think will be more easy now =)
In my Mysqldatabase will have this :
username
password
area
pagetosend
<?
Login Code Written by Matt Slavin
if((!$Username) | (!$Password)) {
print ("Please Enter In THe Correct Name");
}
mysql_connect("localhost","User_Name_here","Password_Here");
mysql_select_db("My_Database_Here");
This part is sort if ya want to. I would suggest it.
Make your login page have the main value of Password
#Comment Out if you Want too
$Password = md5($Password);
$sql = "select * from My_Table where Password=$Password and Username=$Username";
I think that need put here to him check and put into a variable the page name.
Like: phpbuilder.php
#
$result = mysql_query($sql);
$num = mysql_numrows($result);
If Login Is Okay Do What You Want TO DO to Them
if ($num == "1") {
print ("Logged in okay");
#Or you can send them somwhere nice like hawaii
I think that i put here below the variable to take from the Mysqldatabase to the right page.
header("Location: http://www.hawii");
exit;
or even fetch feild about them or save sessions
Here i can put to save under a session the area name ! To the other php check if the users it's the right one.
session_start();
session_register(Username);
}
And we must a have a default error message if login fails
if ($num == "0"){
print ("Sorry Bub You can't enter here!!");
}
?>
In the other page the phpbuilder.php
i just put to him check if the user has the right session register if not the bye bye.