Solved

PHP Code Help Neded

Posted on 2014-07-21
4
258 Views
Last Modified: 2014-07-21
The code below is displayed as part of a script. I'm trying to get "To go to the main page click here" to be the bottom line but keep getting  an error on this line that says "Parse error; unexpected T_STRING, expecting ',' or ';'

Can someone help me out.....I can't figure it out...I think I've looked at it too long. lol, thanks

echo "<p><center><h2>My Office</h2></center></p>";
echo "<p><h3><center>Office Three</center></h3></p>";
echo "<center>An email has been sent to the person who made this assignment notifying them it is complete."; 
echo "<center>To go to the main page <a href="http://mysite/flow/index.html">click here</a>.</b></i></p></center>

Open in new window

0
Comment
Question by:wantabe2
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
Randy Poole earned 500 total points
Comment Utility
echo "<p><center><h2>My Office</h2></center></p>";
echo "<p><h3><center>Office Three</center></h3></p>";
echo "<center>An email has been sent to the person who made this assignment notifying them it is complete."; 
echo "<center>To go to the main page <a href='http://mysite/flow/index.html'>click here</a>.</b></i></p></center>";

Open in new window

0
 
LVL 34

Expert Comment

by:gr8gonzo
Comment Utility
The problem is this line:
echo "<center>To go to the main page <a href="http://mysite/flow/index.html">click here</a>.</b></i></p></center>

The double-quotes in the link should be escaped, and the line should end with "; like this:

echo "<center>To go to the main page <a href=\"http://mysite/flow/index.html\">click here</a>.</b></i></p></center>";
0
 
LVL 21

Expert Comment

by:Randy Poole
Comment Utility
You had " inside your " and was missing the "; at the end of the line as well.
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
You have nested " in the string - just escape them with \ - or use a single apostrophe to wrap the string

Escaping
echo "<p><center><h2>My Office</h2></center></p>";
echo "<p><h3><center>Office Three</center></h3></p>";
echo "<center>An email has been sent to the person who made this assignment notifying them it is complete."; 
echo "<center>To go to the main page <a href=\"http://mysite/flow/index.html\">click here</a>.</b></i></p></center>";

Open in new window

Using an apostrophe
echo '<p><center><h2>My Office</h2></center></p>';
echo '<p><h3><center>Office Three</center></h3></p>';
echo '<center>An email has been sent to the person who made this assignment notifying them it is complete.'; 
echo '<center>To go to the main page <a href="http://mysite/flow/index.html">click here</a>.</b></i></p></center>';

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now