Im Trying To Display The Users , Username, Phone Number, Name, Email… Etc… I Have Already Created The Tables But I Cant Get The Information Displayed On This Page.
checklogin.php
[php]
?php
$host="##########"; // Host name
$username="########"; // Mysql username
$password="######"; // Mysql password
$db_name="######_members"; // Database name
$tbl_name=“members”; // Table name
// Connect to server and select databse.
mysql_connect("$host", “$username”, “$password”)or die(“cannot connect”);
mysql_select_db("$db_name")or die(“cannot select DB”);
// username and password sent from form
$myusername=$_POST[‘myusername’];
$mypassword=$_POST[‘mypassword’];
// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$firstname = stripslashes($firstname);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$firstname = mysql_real_escape_string($firstname);
$sql=“SELECT * FROM $tbl_name WHERE username=’$myusername’ and password=’$mypassword’”;
$sqlinfo =“SELECT * FROM $tbl_name WHERE username=’$myusername’ and firstname=’$firstname’”;
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file “login_success.php”
session_register(“myusername”);
session_register(“mypassword”);
session_register(“firstname”);
header(“location:home.html”);
}
else {
echo “You Have Entered Incorrect Credentials. If You Have Forgot You Credentials Please Email Us.”;
}
?>
[/php]
myinfo.php
[php]
echo “Your Name Is”.$_SESSION[‘firstname’];
?>
[/php]
Thank You In Advance
Jordan