trq Posted August 5, 2008 Share Posted August 5, 2008 I don't get a DB error anymore Likely because the error supressors are back in place. Remove them! Quote Link to comment Share on other sites More sharing options...
webguync Posted August 5, 2008 Author Share Posted August 5, 2008 I removed them, but still the same result :-( Quote Link to comment Share on other sites More sharing options...
trq Posted August 5, 2008 Share Posted August 5, 2008 Then the records do not exist. Are you sure all field names are correct? Try this... <?php error_reporting(E_ALL); ini_set('display_errors','1'); if (isset($_POST['Submit'])) { //connect to MySQL and select database to use //set up database and table names $db_name ="shadowdata"; $table_name ="RegistrationForm"; // connect to MySQL and select database to use $connection = mysql_connect("localhost","username","password") or die(mysql_error()); $db = mysql_select_db($db_name) or die(mysql_error()); $username = mysql_real_escape_string($_POST['loginemail']); $userpw = mysql_real_escape_string($_POST['loginpw']); $sql = "SELECT loginemail,loginpw FROM RegistrationForm WHERE loginemail = '$username' AND loginpw = '$userpw'"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { session_start(); $_SESSION['logged'] = true; header("Location: console.php"); } else { header("Location: index.php?error=x"); } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; } } ?> Quote Link to comment Share on other sites More sharing options...
revraz Posted August 5, 2008 Share Posted August 5, 2008 Are your PW's encrypted in the DB? Because you are not encrypting them when you check it. Quote Link to comment Share on other sites More sharing options...
webguync Posted August 5, 2008 Author Share Posted August 5, 2008 I will give it another try this evening. No the passwords are not encrypted in the DB. Quote Link to comment Share on other sites More sharing options...
webguync Posted August 6, 2008 Author Share Posted August 6, 2008 I don't get the Query failed error, but I do get the error page, even though the user name and password I am entering is in the database. Quote Link to comment Share on other sites More sharing options...
revraz Posted August 6, 2008 Share Posted August 6, 2008 echo them both out and see why they don't match Quote Link to comment Share on other sites More sharing options...
webguync Posted August 6, 2008 Author Share Posted August 6, 2008 can you provide a quick example of what you are referring to? Quote Link to comment Share on other sites More sharing options...
webguync Posted August 7, 2008 Author Share Posted August 7, 2008 for some reason I am still just getting a blank white page even though errors should be displaying. Not sure where the error is. Any help? <?php error_reporting(E_ALL); ini_set('display_errors','1'); if (isset($_POST['Submit'])) { //connect to MySQL and select database to use //set up database and table names $db_name ="shadowdata"; $table_name ="RegistrationForm"; // connect to MySQL and select database to use $connection = mysql_connect("localhost","username","PW") or die(mysql_error()); $db = mysql_select_db($db_name) or die(mysql_error()); $username = mysql_real_escape_string($_POST['loginemail']); $userpw = mysql_real_escape_string($_POST['loginpw']); $sql = "SELECT loginemail,loginpw FROM RegistrationForm WHERE loginemail = '$username' AND loginpw = '$userpw'"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { session_start(); $_SESSION['logged'] = true; header("Location: console.php"); } else { header("Location: index.php?error=x"); } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; } } ?> Quote Link to comment Share on other sites More sharing options...
webguync Posted August 7, 2008 Author Share Posted August 7, 2008 any ideas on this? Quote Link to comment Share on other sites More sharing options...
trq Posted August 7, 2008 Share Posted August 7, 2008 Were going to need to place some echo's in the script to debug. <?php error_reporting(E_ALL); ini_set('display_errors','1'); echo "script called<br />" if (isset($_POST['Submit'])) { echo "Within the if<br />"; //connect to MySQL and select database to use //set up database and table names $db_name ="shadowdata"; $table_name ="RegistrationForm"; // connect to MySQL and select database to use $connection = mysql_connect("localhost","username","PW") or die(mysql_error()); $db = mysql_select_db($db_name) or die(mysql_error()); $username = mysql_real_escape_string($_POST['loginemail']); $userpw = mysql_real_escape_string($_POST['loginpw']); $sql = "SELECT loginemail,loginpw FROM RegistrationForm WHERE loginemail = '$username' AND loginpw = '$userpw'"; if ($result = mysql_query($sql)) { echo "Query success<br />"; if (mysql_num_rows($result)) { echo "Match found<br />"; session_start(); $_SESSION['logged'] = true; //header("Location: console.php"); } else { echo "No match found<br />"; //header("Location: index.php?error=x"); } } else { echo "Query failed<br />" . mysql_error() . "<br />$sql"; } } ?> What does that produce? Quote Link to comment Share on other sites More sharing options...
webguync Posted August 8, 2008 Author Share Posted August 8, 2008 i'm not sure where the error is b/c i just get a blank white page still :-( Quote Link to comment Share on other sites More sharing options...
trq Posted August 8, 2008 Share Posted August 8, 2008 What is the name of this script? And can we see your form? Quote Link to comment Share on other sites More sharing options...
webguync Posted August 8, 2008 Author Share Posted August 8, 2008 login.php can be found here: http://www.shadowmarket.com/real-estate/x/login.php here is the form script <? include('x.php'); $error = $_REQUEST['error']; ?><br> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <? include('header_admin.php') ?> <body> <div align="center"> <table width="750" border="1" align="center" cellpadding="0" bordercolor="#000000" bgcolor="#FFFFFF"> <tr> <td bordercolor="#FFFFFF"><div align="center"> <table width="750" border="0" align="center" cellpadding="5" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> <tr> <td colspan="2"><div align="center"><img src="../template_images/x_top.gif" width="750" height="75"></div></td> </tr> <tr> <td colspan="2" valign="top"><? include('menu.php'); ?></td> </tr> <? if($logout) { print"<tr bgcolor='#CCFF00'>"; } elseif($error) { print"<tr bgcolor='#FF0000'>"; } else { print"<tr>"; } ?> <td colspan="2" valign="top"><div align="center"> <table width="100%" border="1" align="center" cellpadding="0" bordercolor="#999999" bgcolor="#FFFFFF"> <tr> <td valign="top" bordercolor="#FFFFFF" bgcolor="#eeeeee"><div align="center" class="style1">System Administration <? include('xver.txt');?> Console</div></td> </tr> </table> <form action="login.php" method="post" name="xconsole" id="xconsole"> <table width="100%" border="1" align="center" cellpadding="0" bordercolor="#999999" bgcolor="#FFFFFF"> <tr> <td width="25%" bordercolor="#FFFFFF"><div align="right" class="style4"> <? if($logout == "x") { print"<b>Log Out X Console = Success !</b>"; } if($error) { print"<b>X Console Login = Error !</b>"; } if($logout == "y") { print"<b>Log Out X Console = Success ! Login Updated</b>"; } ?> </div></td> <td width="25%" bordercolor="#FFFFFF"><div align="right"><span class="style4">Email Address </span></div></td> <td width="50%" bordercolor="#FFFFFF"><div align="left" class="style4"> <input name="loginemail" type="text" id="q"> </div></td> </tr> <tr> <td colspan="2" bordercolor="#FFFFFF"><div align="right" class="style4">Password</div></td> <td valign="top" bordercolor="#FFFFFF"><div align="left" class="style4"> <input name="loginpw" type="password" id="t"> </div></td> </tr> </table> <br> <input type="submit" name="Submit" value="X Console Login"> <br> </form> </div></td> </tr> <tr> <td width="448"><div align="center" class="style9"> <div align="left"><a href="http://www.listingagent.ca" target="_blank"> <? print"$fc"; ?> : Installed Version # <? include('ver.txt'); include('xver.txt');?></a></div> </div></td> <td width="290"><div align="center" class="style9"> <div align="right"><a href="index.php"><? print"$x_console"; ?></a></div> </div></td> </tr> </table> </div></td> </tr> </table> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
webguync Posted August 8, 2008 Author Share Posted August 8, 2008 any ideas on what is wrong here? Quote Link to comment Share on other sites More sharing options...
webguync Posted August 8, 2008 Author Share Posted August 8, 2008 anyone? Quote Link to comment Share on other sites More sharing options...
webguync Posted August 9, 2008 Author Share Posted August 9, 2008 help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.