deleet Posted July 22, 2009 Share Posted July 22, 2009 This page was working fine 2 hours ago but now it's not. <?php $user_name = "----"; // replace your user name within the 2x " $password = "-----"; // replace your password within the 2x " $database_name = "--------"; // replace the database name within the 2x " $table_name = "member"; $namea = strtolower($_REQUEST["firstnamea"]); $assworda =$_REQUEST["passworda"]; $dbh = mysql_connect("localhost", $user_name, $password, $database_name); session_start(); $dbh = mysql_connect("localhost", $user_name, $password, $database_name); if (!$dbh) { } else { mysql_select_db("********", $dbh); $query = "SELECT * FROM member WHERE username='$namea' and password='$assworda'"; $result = mysql_query( $query ) or exit( mysql_error() ); if (!$result) { echo "THIS SHOULD NOT BE A BLANK SCREEN BUT IT IS"; } else {while($row = mysql_fetch_array($result)) { if ($row['password']==$assworda) {if (strtolower($row['username'])==$namea) {$SESSION['email']=$row['email']; $_SESSION['myaff']=$row['id']; $_SESSION['views'] = $_SESSION['views']+ 1;if ($row['gold']=='1'){ $_SESSION['gold']="gold";include('top.php');}else { include('main.php');} } }}}} ?> My brain box of a business partner decided to launch while I was trying to fix this, so any help would be appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/166922-getting-blank-screen-when-trying-to-include-or-redirect/ Share on other sites More sharing options...
trq Posted July 22, 2009 Share Posted July 22, 2009 Have you got error reporting & display errors enabled? Link to comment https://forums.phpfreaks.com/topic/166922-getting-blank-screen-when-trying-to-include-or-redirect/#findComment-880075 Share on other sites More sharing options...
deleet Posted July 22, 2009 Author Share Posted July 22, 2009 I do, I've had some smaller syntax errors pop up and I fixed those by going right to the line in question. I ran a syntax check and my friend got the same result from his computer which also has errors on. Link to comment https://forums.phpfreaks.com/topic/166922-getting-blank-screen-when-trying-to-include-or-redirect/#findComment-880079 Share on other sites More sharing options...
trq Posted July 22, 2009 Share Posted July 22, 2009 Then it likely is some fatal error. You'll need to format your code so it is at least readable and see if your find any errors that way. As it stands, that code is terribly formatted. Link to comment https://forums.phpfreaks.com/topic/166922-getting-blank-screen-when-trying-to-include-or-redirect/#findComment-880092 Share on other sites More sharing options...
haku Posted July 22, 2009 Share Posted July 22, 2009 I'm thinking maybe the database connection is failing - there is no contingency for that: $dbh = mysql_connect("localhost", $user_name, $password, $database_name); if (!$dbh) { } Try putting something inside the 'if' statement: $dbh = mysql_connect("localhost", $user_name, $password, $database_name); if (!$dbh) { die("this is where it's dying"); } Link to comment https://forums.phpfreaks.com/topic/166922-getting-blank-screen-when-trying-to-include-or-redirect/#findComment-880102 Share on other sites More sharing options...
deleet Posted July 22, 2009 Author Share Posted July 22, 2009 I first had a die message, then a redirect, then an echo with some pithy language before it became a blank but thanks for weighing in though. Link to comment https://forums.phpfreaks.com/topic/166922-getting-blank-screen-when-trying-to-include-or-redirect/#findComment-880110 Share on other sites More sharing options...
Coreye Posted July 22, 2009 Share Posted July 22, 2009 I'm not sure if this is the problem but $SESSION['email']=$row['email']; should be $_SESSION['email'] = $row['email']; Link to comment https://forums.phpfreaks.com/topic/166922-getting-blank-screen-when-trying-to-include-or-redirect/#findComment-880200 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.