Jump to content

Syntax error please help


EchoFool

Recommended Posts

I have a syntax error when creating a string to my variable, but I don't know how to fix it. Could you help me please! :)

 

My error is:

Parse error: syntax error, unexpected '[', expecting ')' in C:\xampp\htdocs\register.php on line 137

 

It's relating to this linke

$message = $message. "localhost/activate.php?x=" .mysql_insert_id(['UserID]). "&y=$EmailCode";
in the script below:

 

<?php
$query = "INSERT INTO `tableusers` (Username,Password,Email,CountryID,IP,Gender,RegisterDate,JobTitle,ActivateCode)
				Values ('$Username', '$Password', '$Email', '$Country', '$ip', '$Gender', '$Date', 'Unemployed','$EmailCode')";
	mysql_query($query) or die(mysql_error());
	unset($_SESSION['security_code']);
	if (mysql_affected_rows() == 1) {
	// Send the email.

		$subject = "Welcome";
		$headers = 'From: Admin';
		$message = "Thank you for registering.. To activate your account, please click on this link:\n\n";
		$message = $message. "localhost/activate.php?x=" .mysql_insert_id(['UserID']). "&y=$EmailCode";
		mail($Email, $subject, $message, $headers);
?>

 

Hope you can help me out.

Link to comment
https://forums.phpfreaks.com/topic/102741-syntax-error-please-help/
Share on other sites

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.