vasoftwaresolutions Posted March 14, 2008 Share Posted March 14, 2008 i am having trouble eching my users account info... here is the code... you can see that i try to echo there first name then the New Pilots.. any help is gratly appreshated... <?php $pagename = "Pilot Overview"; ?> <?php $host="localhost"; // Host name $username="pacifij1_vass"; // Mysql username $password="8336994895"; // Mysql password $db_name="pacifij1_vass"; // Database name $tbl_name="virtualairlines"; // Table name session_start(); if(!session_is_registered('username') AND !session_is_registered('pwd') AND !session_is_registered('first_name') AND !session_is_registered('last_name')){ header( 'Location: http://vasoftwaresolutions.com/'); exit(); } $username = $_POST['username']; $first_name = $_POST['first_name']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $pagename; ?></title> <style type="text/css"> <!-- body { background-color: #003366; } --> </style> <link href="css/style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style1 {color: #C0C0C0} --> </style> </head> <body> <div align="center"> <table width="800" border="3" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF"> <tr> <td><table width="800" border="1" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF"> <tr> <td><div align="center"><a href="index.php" class="linkblue">Home</a></div></td> <td><div align="center"><a href="new-pilots.php" class="linkblue">New Pilots</a></div></td> <td><div align="center"><a href="new-pireps.php" class="linkblue">New PIREP's</a></div></td> <td><div align="center"><a href="routes.php" class="linkblue">Routes</a></div></td> <td><div align="center"><a href="fleet.php" class="linkblue">Fleet</a></div></td> <td><div align="center"><a href="statistics.php" class="linkblue">Statistics</a></div></td> <td><div align="center"><a href="scripts.php" class="linkblue">Scripts</a></div></td> <td><div align="center"><a href="airline-profile.php" class="linkblue">Airline Profile</a></div></td> <td><div align="center"><a href="logout.php" class="linkblue">Logout</a></div></td> </tr> </table> <table width="800" border="3" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF"> <tr> <td><p class="style1">Hello <?php echo $first_name; ?>,</p> <p class="style1">Welcome To Your Admin Centre For VASS!! Have Fun</p> <p> <?php $hostname = "localhost"; $database = "pacifij1_vass"; $username = "pacifij1_vass"; $password = "8336994895"; $vrbo = mysql_connect($hostname, $username, $password) or die(mysql_error()); $username = $_POST[username]; mysql_select_db($database, $vrbo); $query_Session_Info = ("SELECT * FROM pilots WHERE username = '$username' and approved = '0'"); $Session_Info = mysql_query($query_Session_Info, $vrbo) or die(mysql_error()); $row_Session_Info = mysql_fetch_assoc($Session_Info); $totalRows_Session_Info = mysql_num_rows($Session_Info); ?> </p> <p><font color="cccccc" size="7">New Pilots</font> <table width="270" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="128" class="style6 style1">Callsign</td> <td width="128" class="style6 style1">Country</td> </tr> <?php do { ?><tr> <td class="style6 style1"><?php echo $row_Session_Info['first_name']; ?> <?php echo $row_Session_Info['last_name']; ?></td> <td class="style6"><a href="newpilots.php" class="linkblue">Add Pilot</a></td> </tr> <?php } while ($row_Session_Info = mysql_fetch_assoc($Session_Info)); ?> </table> </p> <p> </p></td> </tr> </table> </td> </tr> </table> <p class="style1">© Copyright 2008 Nick Tyson And John Glendenning. © Copyright 2008 VASS. All Rights Reserved.</p> </div> </body> </html> Link to comment https://forums.phpfreaks.com/topic/96080-php-echo-etc/ Share on other sites More sharing options...
unsider Posted March 14, 2008 Share Posted March 14, 2008 if(!session_is_registered('username') || !session_is_registered('pwd') || !session_is_registered('first_name') || !session_is_registered('last_name')){ I only noticed one thing, isn't it more proper to use || as opposed to AND? Link to comment https://forums.phpfreaks.com/topic/96080-php-echo-etc/#findComment-491853 Share on other sites More sharing options...
unsider Posted March 14, 2008 Share Posted March 14, 2008 $username = $_POST[username]; Noticed that as well. $username = $_POST['username']; Link to comment https://forums.phpfreaks.com/topic/96080-php-echo-etc/#findComment-491854 Share on other sites More sharing options...
dbillings Posted March 14, 2008 Share Posted March 14, 2008 Your post username and mysql username use the same variable $username and I don't see a form submiss ion to populate your post array. Link to comment https://forums.phpfreaks.com/topic/96080-php-echo-etc/#findComment-491857 Share on other sites More sharing options...
Stooney Posted March 14, 2008 Share Posted March 14, 2008 if(!session_is_registered('username') || !session_is_registered('pwd') || !session_is_registered('first_name') || !session_is_registered('last_name')){ I only noticed one thing, isn't it more proper to use || as opposed to AND? Two different things && = AND || = OR Link to comment https://forums.phpfreaks.com/topic/96080-php-echo-etc/#findComment-491862 Share on other sites More sharing options...
unsider Posted March 14, 2008 Share Posted March 14, 2008 if(!session_is_registered('username') || !session_is_registered('pwd') || !session_is_registered('first_name') || !session_is_registered('last_name')){ I only noticed one thing, isn't it more proper to use || as opposed to AND? Two different things && = AND || = OR Oh whoops, I'm glad you caught me, that would have been a horrible mistake. Link to comment https://forums.phpfreaks.com/topic/96080-php-echo-etc/#findComment-491867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.