|
-
Apr 2nd, 2015, 02:13 AM
#3
Thread Starter
Hyperactive Member
Re: Parse error: syntax error, unexpected '$name' (T_VARIABLE)
Thanks so much didnt have a look at it that way . It was worth the experience. Cheers
 Originally Posted by dclamp
You need to use a period / decimal point to concatenate that string. You can also encapsulate the entire string with double quotes and use the string name alone.
PHP Code:
$msg_to_user='<br/></br><h4><font color= "FF0000">Please input a Valid Email Address ' . $name . ' </font></h4>';
// or:
$msg_to_user="<br/></br><h4><font color= 'FF0000'>Please input a Valid Email Address {$name} </font></h4>"; //I also changed the font color quotes.
Its also not recommended to put very much HTML in php Strings. It is considered good practice to separate PHP from HTML as much as possible.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|