0

while executing the below program i am getting the error "Parse error: syntax error, unexpected '<<' (T_SL) in C:\xampp\htdocs\registration.php on line 5" . can i get some help ??

<?php
extract($_POST);
include "connection.php";
$link= md5($txtuname);
$str= <<<abc 
account is created click on the activation link <a href="http://abc.com/active.php?$link">click </a>
abc;
if(mysql_query("insert tbl_user values ('$txtuname','$txtpwd','$txtemail','0','$link')"))
{
    echo "registration completed";
    mail($txtemail,"activation link", "$str","from: admin@abc.com \r \n content type:text/html");
}
else
{
    if (mysql_error()==1062)
    {
        echo "username exist";
    }
}
?>
3
Contributors
4
Replies
26
Views
2 Years
Discussion Span
Last Post by Gideon_1
0

That works for me and I can't see anything wrong. But you should check for whitespace on line 7 though. Extra white space can interfere with <<< functionality.
Putting a space at the end of line 7 broke what was working for me just now.

0

thanks but after removing the white space now m getting error like "Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\registration.php on line 20"

<?php
extract($_POST);
include "connection.php";
$link= md5($txtuname);
$str = <<<abc
account is created click on the activation link <a href="http://abc.com/active.php?$link">click</a>
abc;  
if(mysql_query("insert tbl_user values ('$txtuname','$txtpwd','$txtemail','0','$link')"))
{
    echo "registration completed";
    mail($txtemail,"activation link", "$str","from:admin@abc.com \r \n contenttype:text/html");
}
else
    {
        if(mysql_error()==1062)
        {
        echo "username exist";
        }
    }
?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.