jigsawsoul Posted March 25, 2010 Share Posted March 25, 2010 It will not echo 'Registration was successful'; but if the lines placed above $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); works fine <?php session_start(); ob_start(); include('../resources/config.php'); include($config["paths"]["resources"] . 'opendb.php'); include($config["paths"]["resources"] . '_library/login.php'); $_SESSION['message'] = ""; if (empty($_POST['email'])) $_SESSION['message'] .= "<li>A email address is required.<br /></li>"; if (empty($_POST['password'])) $_SESSION['message'] .= "<li>A password is required.<br /></li>"; if ($_POST['password'] != $_POST['password2']) $_SESSION['message'] .= "<li>Passwords don't match<br /></li>"; if (!empty($_SESSION['message'])) { $_SESSION['message'] .= "<br />"; header("Location: register.php"); exit(); } $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); $result = mysql_query("SELECT email FROM projectlogin WHERE email = '$email'"); $emailcheck = mysql_num_rows($result) or die(mysql_error()); echo 'Registration was successful'; if($emailcheck > 0){ $_SESSION["message"] = "<li>Email address already in use.<br /><br /></li>"; header ('Location: register.php'); exit; } echo 'Registration was successful'; include($config["paths"]["resources"] . 'closedb.php'); ?> Anyone see a problem or why this might be happening? Quote Link to comment https://forums.phpfreaks.com/topic/196498-not-echoing-message-help/ Share on other sites More sharing options...
tekrscom Posted March 25, 2010 Share Posted March 25, 2010 Could it have something to do with your exit function above? Quote Link to comment https://forums.phpfreaks.com/topic/196498-not-echoing-message-help/#findComment-1031674 Share on other sites More sharing options...
Maq Posted March 25, 2010 Share Posted March 25, 2010 Temporarily turn error_reporting to max by placing the following lines directly after your opening PHP tags: ini_set ("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment https://forums.phpfreaks.com/topic/196498-not-echoing-message-help/#findComment-1031688 Share on other sites More sharing options...
jigsawsoul Posted March 25, 2010 Author Share Posted March 25, 2010 Adding this code doesn't do anything or display a problem anywhere? anyone have a better idea??? i really stuck ini_set ("display_errors", "1"); error_reporting(E_ALL); <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); session_start(); ob_start(); include('../resources/config.php'); include($config["paths"]["resources"] . 'opendb.php'); include($config["paths"]["resources"] . '_library/login.php'); $_SESSION['message'] = ""; if (empty($_POST['email'])) $_SESSION['message'] .= "<li>A email address is required.<br /></li>"; if (empty($_POST['password'])) $_SESSION['message'] .= "<li>A password is required.<br /></li>"; if ($_POST['password'] != $_POST['password2']) $_SESSION['message'] .= "<li>Passwords don't match<br /></li>"; if (!empty($_SESSION['message'])) { $_SESSION['message'] .= "<br />"; header("Location: register.php"); exit(); } $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); $result = mysql_query("SELECT email FROM projectlogin WHERE email = '$email'"); $emailcheck = mysql_num_rows($result) or die(mysql_error()); echo 'Registration was successful'; if($emailcheck > 0){ $_SESSION["message"] = "<li>Email address already in use.<br /><br /></li>"; header ('Location: register.php'); exit; } echo 'Registration was successful'; include($config["paths"]["resources"] . 'closedb.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/196498-not-echoing-message-help/#findComment-1031710 Share on other sites More sharing options...
alberrambo Posted March 25, 2010 Share Posted March 25, 2010 ini_set ("display_errors", "1"); error_reporting(E_ALL); please set these . Quote Link to comment https://forums.phpfreaks.com/topic/196498-not-echoing-message-help/#findComment-1031714 Share on other sites More sharing options...
jigsawsoul Posted March 25, 2010 Author Share Posted March 25, 2010 look above at the code and your see i have set that peace of code, but it doesn't show up anything at all ??? Quote Link to comment https://forums.phpfreaks.com/topic/196498-not-echoing-message-help/#findComment-1031718 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.