Jump to content

Parse Error


unemployment

Recommended Posts

I have been getting a parse error on my code.  Any thoughts as to why?

 

                                            echo "<div id='memberContent'> 

						<div id='welcome'>

							Welcome, \".$r['firstname'].\"!

						</div><br>

						<div class='profileImage'>

							<img src=\"assets/img/avatars/.$r['imagename']\" alt=\"Profile Picture\" height=\"90px\" title=\"$firstname.' '.$lastname\" />

						</div>

						<div id='addfriend'>

							<a href='request.php'>Connect</a>

						</div>

					</div>
					";

Link to comment
https://forums.phpfreaks.com/topic/218012-parse-error/
Share on other sites

You need to read up on the use of single/double quotes and concatenation

 

echo "<div id='memberContent'> 

						<div id='welcome'>

							Welcome, ".$r['firstname']."!

						</div><br>

						<div class='profileImage'>

							<img src='".assets/img/avatars/".$r['imagename']."' alt='Profile Picture' height='90px' title=".$firstname." ".$lastname" />

						</div>

						<div id='addfriend'>

							<a href='request.php'>Connect</a>

						</div>

					</div>
					";

Link to comment
https://forums.phpfreaks.com/topic/218012-parse-error/#findComment-1131398
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.