Jump to content

[SOLVED] white space error


jeppers

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.