mrMarcus Posted October 6, 2009 Share Posted October 6, 2009 can you post exact code up until the error is being generated .. php and all. Quote Link to comment Share on other sites More sharing options...
orange08 Posted October 7, 2009 Author Share Posted October 7, 2009 can you post exact code up until the error is being generated .. php and all. this is my login page that always will load as blank... <?php session_start(); include 'config.php'; include 'adcms_function.php'; include 'error_function.php'; include 'chkget.php'; function retrieve_data(){ $select_profile = mysql_query("SELECT * FROM submitter WHERE submitter_id=$_SESSION[logged_id]")or custom_error_handle(10); if(mysql_num_rows($select_profile)>0){ while($row = mysql_fetch_array($select_profile,MYSQL_ASSOC)){ if($row["submitter_id"]==$_SESSION['logged_id']){ $_SESSION['logged_email'] = htmlentities($row["sbm_email"]); $_SESSION['edit_gender'] = $row["sbm_gender"]; $_SESSION['edit_dob'] = $row["sbm_dob"]; $_SESSION['edit_dob'] = (string)$_SESSION['edit_dob']; $_SESSION['edit_dob'] = explode('-', $_SESSION['edit_dob']); $_SESSION['edit_yr'] = $_SESSION['edit_dob'][0]; $_SESSION['edit_mth'] = $_SESSION['edit_dob'][1]; $_SESSION['edit_date'] = $_SESSION['edit_dob'][2]; $_SESSION['edit_password'] = $row["sbm_password"]; $_SESSION['edit_usercreated'] = $row["create_user"]; $_SESSION['edit_sbmtm'] = $row["sbm_time"]; $_SESSION['edit_emailsent'] = $row["email_sent2u"]; $_SESSION['edit_lastlogin'] = $row["lastest_login"]; } } } } //end of function function reset_password($user_name,$mail,$key){ $user_name1 = htmlentities($user_name); $mail1 = htmlentities($mail); $header="MIME-version:1.0\r\n"; $header.="Content-type:text/html; charset=UTF-8\r\n"; $header.="Content-Transfer-Encoding:7bit\r\n"; $header.="From: mymail@mysite.com\r\n"; $subject="Reset Password"; $msg="<table><tr><td>"; $msg.="Dear $user_name1,"; $msg.="<br>"; $msg.="<br></td></tr></table>"; $msg.="For the security purpose, you are required to reset your password with the following link:<br>"; $msg.="<a href='http://www.mysite.com/change_password.php?resetemail=$mail1&resetkey=$key'>Reset Password link<br><br> </a>"; $msg.="If the above link is not supported by your email program, <br>"; $msg.="please copy and paste the following link to your browser.<br><br>"; $msg.="http://www.mysite.com/change_password.php?resetemail=$mail1&resetkey=$key"; $msg.="<br>"; $msg.="<br>"; $msg.="Regards,<br>"; $msg.="mysite Team"; $msg.="</td></tr></table></center>"; $mailpass=mail($mail,$subject,$msg,$header); } if (isset($_GET['status'])){ $urstatus = (int)$_GET['status']; if($urstatus==1){ session_destroy(); echo "<META HTTP-EQUIV='refresh' content='0;URL=index.php?page=1'>"; }else{ echo "Invalid Request"; exit(); } } if(isset($_POST['loginbtn'])){ $chk_sts = 'N'; $_SESSION['user_nm'] = mysql_real_escape_string($_POST['user_login']); $login_pass = sha1(mysql_real_escape_string($_POST['user_loginpass'])); $loginsql = mysql_query("SELECT * FROM submitter WHERE submitter_name='$_SESSION[user_nm]' AND sbm_password='$login_pass'")or custom_error_handle(10); if(mysql_num_rows($loginsql)>0){ while($row = mysql_fetch_array($loginsql,MYSQL_ASSOC)){ if($row["submitter_name"]==$_SESSION['user_nm']){ $_SESSION['logged_id'] = $row["submitter_id"]; $_SESSION['logged_user'] = $row["submitter_name"]; //$_SESSION['logged_email'] = $row["sbm_email"]; $chk_sts = 'Y'; } } retrieve_data(); // update user latest login date and time if($chk_sts=='Y'){ $SQLquery = "START TRANSACTION"; $SQLrst = mysql_query($SQLquery); $update_login = mysql_query("UPDATE submitter SET lastest_login=NOW() WHERE submitter_id=$_SESSION[logged_id]"); if(!$update_login){ $SQLquery = "ROLLBACK"; $SQLrst = mysql_query($SQLquery); }else{ $SQLquery = "COMMIT"; $SQLrst = mysql_query($SQLquery); } } }else{ echo "<center><table><tr><td bgcolor=#241502><big><span style='color: rgb(255, 0, 0); font-weight: bold;'>Invalid User Name or Password.</span></big></td></tr></table></center>"; } } if(isset($_POST['forgotpass'])){ if(empty($_POST['user_login'])){ echo "<center><table><tr><td bgcolor=#241502><big><span style='color: rgb(255, 0, 0); font-weight: bold;'>Please enter your user name.</span></big></td></tr></table></center>"; }else{ $user = mysql_real_escape_string($_POST['user_login']); $findpass = mysql_query("SELECT sbm_email FROM submitter WHERE submitter_name='$user'")or custom_error_handle(10); if(mysql_num_rows($findpass)>0){ while($row = mysql_fetch_array($findpass,MYSQL_ASSOC)){ $user_email = $row["sbm_email"]; } $user_key = generateKey(); $SQLquery = "START TRANSACTION"; $SQLrst = mysql_query($SQLquery); $updateKey = mysql_query("UPDATE submitter SET activate_key='$user_key' WHERE submitter_name='$user'"); if(!$updateKey){ $SQLquery = "ROLLBACK"; $SQLrst = mysql_query($SQLquery); }else{ $SQLquery = "COMMIT"; $SQLrst = mysql_query($SQLquery); reset_password($user,$user_email,$user_key); echo "<center><table><tr><td bgcolor=#241502><big><span style='color: rgb(255, 255, 0); font-weight: bold;'>Reset password link is sent to your email account.</span></big></td></tr></table></center>"; } } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"> <title>My Site</title> </head> <body style="background-color: rgb(37, 23, 4);"> <?php echo "test page!"; ?> <center> <table style="text-align: left; margin-right: auto; margin-left: auto;" bgcolor="#f5ba18" border="0" cellpadding="0" cellspacing="0"> <tbody> <?php include 'siteheader.php'; ?> <tr> <center><form action="index.php?page=1" method="post"><table bgcolor="#f5ba18" width="900px"> <tr> <td align="right" width="450px" height="100px"><b>User Name</b></td> <td align="left" width="450px"><input name="user_login" maxlength="15" size="25" value="<?php if(!empty($_SESSION['user_nm'])) echo htmlentities($_SESSION['user_nm']);?>"></td> </tr> <tr> <td align="right" width="450px"><b>Password</b></td> <td align="left" width="450px"><input name="user_loginpass" maxlength="10" size="25" type="password"></td> </tr> <tr> <td></td> <td align="left" height="100px"><input name="loginbtn" value="Log In" type="submit"><input name="forgotpass" value="Forgot Password" type="submit"></td> </tr> </table></form></center> </tr> </tbody> </table> </center> </body> </html> Quote Link to comment Share on other sites More sharing options...
orange08 Posted October 8, 2009 Author Share Posted October 8, 2009 can you post exact code up until the error is being generated .. php and all. this is my login page that always will load as blank... <?php session_start(); include 'config.php'; include 'adcms_function.php'; include 'error_function.php'; include 'chkget.php'; function retrieve_data(){ $select_profile = mysql_query("SELECT * FROM submitter WHERE submitter_id=$_SESSION[logged_id]")or custom_error_handle(10); if(mysql_num_rows($select_profile)>0){ while($row = mysql_fetch_array($select_profile,MYSQL_ASSOC)){ if($row["submitter_id"]==$_SESSION['logged_id']){ $_SESSION['logged_email'] = htmlentities($row["sbm_email"]); $_SESSION['edit_gender'] = $row["sbm_gender"]; $_SESSION['edit_dob'] = $row["sbm_dob"]; $_SESSION['edit_dob'] = (string)$_SESSION['edit_dob']; $_SESSION['edit_dob'] = explode('-', $_SESSION['edit_dob']); $_SESSION['edit_yr'] = $_SESSION['edit_dob'][0]; $_SESSION['edit_mth'] = $_SESSION['edit_dob'][1]; $_SESSION['edit_date'] = $_SESSION['edit_dob'][2]; $_SESSION['edit_password'] = $row["sbm_password"]; $_SESSION['edit_usercreated'] = $row["create_user"]; $_SESSION['edit_sbmtm'] = $row["sbm_time"]; $_SESSION['edit_emailsent'] = $row["email_sent2u"]; $_SESSION['edit_lastlogin'] = $row["lastest_login"]; } } } } //end of function function reset_password($user_name,$mail,$key){ $user_name1 = htmlentities($user_name); $mail1 = htmlentities($mail); $header="MIME-version:1.0\r\n"; $header.="Content-type:text/html; charset=UTF-8\r\n"; $header.="Content-Transfer-Encoding:7bit\r\n"; $header.="From: mymail@mysite.com\r\n"; $subject="Reset Password"; $msg="<table><tr><td>"; $msg.="Dear $user_name1,"; $msg.="<br>"; $msg.="<br></td></tr></table>"; $msg.="For the security purpose, you are required to reset your password with the following link:<br>"; $msg.="<a href='http://www.mysite.com/change_password.php?resetemail=$mail1&resetkey=$key'>Reset Password link<br><br> </a>"; $msg.="If the above link is not supported by your email program, <br>"; $msg.="please copy and paste the following link to your browser.<br><br>"; $msg.="http://www.mysite.com/change_password.php?resetemail=$mail1&resetkey=$key"; $msg.="<br>"; $msg.="<br>"; $msg.="Regards,<br>"; $msg.="mysite Team"; $msg.="</td></tr></table></center>"; $mailpass=mail($mail,$subject,$msg,$header); } if (isset($_GET['status'])){ $urstatus = (int)$_GET['status']; if($urstatus==1){ session_destroy(); echo "<META HTTP-EQUIV='refresh' content='0;URL=index.php?page=1'>"; }else{ echo "Invalid Request"; exit(); } } if(isset($_POST['loginbtn'])){ $chk_sts = 'N'; $_SESSION['user_nm'] = mysql_real_escape_string($_POST['user_login']); $login_pass = sha1(mysql_real_escape_string($_POST['user_loginpass'])); $loginsql = mysql_query("SELECT * FROM submitter WHERE submitter_name='$_SESSION[user_nm]' AND sbm_password='$login_pass'")or custom_error_handle(10); if(mysql_num_rows($loginsql)>0){ while($row = mysql_fetch_array($loginsql,MYSQL_ASSOC)){ if($row["submitter_name"]==$_SESSION['user_nm']){ $_SESSION['logged_id'] = $row["submitter_id"]; $_SESSION['logged_user'] = $row["submitter_name"]; //$_SESSION['logged_email'] = $row["sbm_email"]; $chk_sts = 'Y'; } } retrieve_data(); // update user latest login date and time if($chk_sts=='Y'){ $SQLquery = "START TRANSACTION"; $SQLrst = mysql_query($SQLquery); $update_login = mysql_query("UPDATE submitter SET lastest_login=NOW() WHERE submitter_id=$_SESSION[logged_id]"); if(!$update_login){ $SQLquery = "ROLLBACK"; $SQLrst = mysql_query($SQLquery); }else{ $SQLquery = "COMMIT"; $SQLrst = mysql_query($SQLquery); } } }else{ echo "<center><table><tr><td bgcolor=#241502><big><span style='color: rgb(255, 0, 0); font-weight: bold;'>Invalid User Name or Password.</span></big></td></tr></table></center>"; } } if(isset($_POST['forgotpass'])){ if(empty($_POST['user_login'])){ echo "<center><table><tr><td bgcolor=#241502><big><span style='color: rgb(255, 0, 0); font-weight: bold;'>Please enter your user name.</span></big></td></tr></table></center>"; }else{ $user = mysql_real_escape_string($_POST['user_login']); $findpass = mysql_query("SELECT sbm_email FROM submitter WHERE submitter_name='$user'")or custom_error_handle(10); if(mysql_num_rows($findpass)>0){ while($row = mysql_fetch_array($findpass,MYSQL_ASSOC)){ $user_email = $row["sbm_email"]; } $user_key = generateKey(); $SQLquery = "START TRANSACTION"; $SQLrst = mysql_query($SQLquery); $updateKey = mysql_query("UPDATE submitter SET activate_key='$user_key' WHERE submitter_name='$user'"); if(!$updateKey){ $SQLquery = "ROLLBACK"; $SQLrst = mysql_query($SQLquery); }else{ $SQLquery = "COMMIT"; $SQLrst = mysql_query($SQLquery); reset_password($user,$user_email,$user_key); echo "<center><table><tr><td bgcolor=#241502><big><span style='color: rgb(255, 255, 0); font-weight: bold;'>Reset password link is sent to your email account.</span></big></td></tr></table></center>"; } } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"> <title>My Site</title> </head> <body style="background-color: rgb(37, 23, 4);"> <?php echo "test page!"; ?> <center> <table style="text-align: left; margin-right: auto; margin-left: auto;" bgcolor="#f5ba18" border="0" cellpadding="0" cellspacing="0"> <tbody> <?php include 'siteheader.php'; ?> <tr> <center><form action="index.php?page=1" method="post"><table bgcolor="#f5ba18" width="900px"> <tr> <td align="right" width="450px" height="100px"><b>User Name</b></td> <td align="left" width="450px"><input name="user_login" maxlength="15" size="25" value="<?php if(!empty($_SESSION['user_nm'])) echo htmlentities($_SESSION['user_nm']);?>"></td> </tr> <tr> <td align="right" width="450px"><b>Password</b></td> <td align="left" width="450px"><input name="user_loginpass" maxlength="10" size="25" type="password"></td> </tr> <tr> <td></td> <td align="left" height="100px"><input name="loginbtn" value="Log In" type="submit"><input name="forgotpass" value="Forgot Password" type="submit"></td> </tr> </table></form></center> </tr> </tbody> </table> </center> </body> </html> any problem of my code that causing my page sometime to load as blank page? Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted October 8, 2009 Share Posted October 8, 2009 do you have error_reporting on? Quote Link to comment Share on other sites More sharing options...
Adam Posted October 8, 2009 Share Posted October 8, 2009 Okay, break down the problem... If you remove the PHP at the top, does the error still occur? If you remove the meta content tag, does the error still occur? When the page loads blank, what is in the source? As mrMarcus just asked, do you have error_reporting disabled? Quote Link to comment Share on other sites More sharing options...
orange08 Posted October 12, 2009 Author Share Posted October 12, 2009 do you have error_reporting on? yup, the error_reporting is on, but when the page is loaded as blank, no any error being output... Quote Link to comment Share on other sites More sharing options...
Adam Posted October 12, 2009 Share Posted October 12, 2009 ... and what about the other questions? Quote Link to comment Share on other sites More sharing options...
orange08 Posted October 12, 2009 Author Share Posted October 12, 2009 Okay, break down the problem... If you remove the PHP at the top, does the error still occur? If you remove the meta content tag, does the error still occur? When the page loads blank, what is in the source? As mrMarcus just asked, do you have error_reporting disabled? yup, i have tried before post the code here... even though i remove all php code at the top, only left there the following code <?php session_start(); ?> the page still will be loaded as blank... then, if i remove all php code including the <?php session_start(); ?>, then the page will never load as blank again... i'm really can't figure out what's the problem here. 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.