Solved

PHP Code Help Neded

Posted on 2014-07-21
4
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
Randy Poole earned 500 total points
ID: 40209638
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 35

Expert Comment

by:gr8gonzo
ID: 40209639
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
ID: 40209644
You had " inside your " and was missing the "; at the end of the line as well.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40209647
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

615 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