Jump to content

Recommended Posts

$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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/121089-solved-white-space-error/
Share on other sites

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.";
	}
}

	$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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.