jeppers Posted August 24, 2008 Share Posted August 24, 2008 $sql = "INSERT INTO users(username, password, email, verifystring, active) VALUES('" . $_POST['username'] . "', '" . $_POST['password1'] . "', '" . $_POST['email'] . "', '" . addslashes($randomstring) . "', 0);"; mysql_query($sql); //construct the email to send the user for verification $mail_body=<<<_MAIL_ Hi $validusername, Please Click on the following link to verify your naw account: $verifyurl?email=$verifyemail&verify=$verifystring; _MAIL_; //sending the email mail($_POST['email'], $config_forumsname ." User verification", $mail_body); require("includes/header.php"); echo "A link has been emailed to the address you entered below. please follow the link in the email to validate your account."; } } hi there i am a little stuck i keep on getting this message Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\test\discussion\register.php on line 62 i have done some google research and the problem is just above this line. i am not sure what to do. can you have a look to see what the issue is please. Quote Link to comment https://forums.phpfreaks.com/topic/121089-solved-white-space-error/ Share on other sites More sharing options...
MasterACE14 Posted August 24, 2008 Share Posted August 24, 2008 what line is it exactly? add <?php before the code so the forum highlights the syntax <?php $sql = "INSERT INTO users(username, password, email, verifystring, active) VALUES('" . $_POST['username'] . "', '" . $_POST['password1'] . "', '" . $_POST['email'] . "', '" . addslashes($randomstring) . "', 0);"; mysql_query($sql); //construct the email to send the user for verification $mail_body=<<<_MAIL_ Hi $validusername, Please Click on the following link to verify your naw account: $verifyurl?email=$verifyemail&verify=$verifystring; _MAIL_; //sending the email mail($_POST['email'], $config_forumsname ." User verification", $mail_body); require("includes/header.php"); echo "A link has been emailed to the address you entered below. please follow the link in the email to validate your account."; } } Quote Link to comment https://forums.phpfreaks.com/topic/121089-solved-white-space-error/#findComment-624232 Share on other sites More sharing options...
trq Posted August 24, 2008 Share Posted August 24, 2008 There need be no space prior to _MAIL_; Quote Link to comment https://forums.phpfreaks.com/topic/121089-solved-white-space-error/#findComment-624233 Share on other sites More sharing options...
jeppers Posted August 25, 2008 Author Share Posted August 25, 2008 $sql = "INSERT INTO users(username, password, email, verifystring, active) VALUES('" . $_POST['username'] . "', '" . $_POST['password1'] . "', '" . $_POST['email'] . "', '" . addslashes($randomstring) . "', 0);"; mysql_query($sql); $mail_body=<<<_MAIL_ Hi $validusername, Please Click on the following link to verify your naw account: $verifyurl?email=$verifyemail&verify=$verifystring _MAIL_; mail($_POST['email'], $config_forumsname ." User verification", $mail_body); // for more info please look at page 130 require("includes/header.php");// display a message that the email has been sent echo "A link has been emailed to the address you entered below. please follow the link in the email to validate your account."; } } else {// this deals with if the passwords don't match header("Location: " . $config_basedir . "register.php?error=pass"); // if the submit button is pressed this code wll become active } } well i have taken all of the white space from where it was said to be the issue but i have the same error. any other ideas Quote Link to comment https://forums.phpfreaks.com/topic/121089-solved-white-space-error/#findComment-624826 Share on other sites More sharing options...
wildteen88 Posted August 25, 2008 Share Posted August 25, 2008 _MAIL_; should be on its own line (nothing should be before or after it). Quote Link to comment https://forums.phpfreaks.com/topic/121089-solved-white-space-error/#findComment-624836 Share on other sites More sharing options...
JasonLewis Posted August 25, 2008 Share Posted August 25, 2008 Which is what frustrates me about heredoc, it makes indented code look ugly. Quote Link to comment https://forums.phpfreaks.com/topic/121089-solved-white-space-error/#findComment-624885 Share on other sites More sharing options...
jeppers Posted August 25, 2008 Author Share Posted August 25, 2008 i no what you mean just seems out of place. i have sorted it now. there where a few more problems than i thought but all is good. thanks for the help everyone hope i can help soon Quote Link to comment https://forums.phpfreaks.com/topic/121089-solved-white-space-error/#findComment-624994 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.