Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

PHP Code Help Neded

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
wantabe2
Asked:
wantabe2
  • 2
1 Solution
 
Randy PooleCommented:
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
 
gr8gonzoConsultantCommented:
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
 
Randy PooleCommented:
You had " inside your " and was missing the "; at the end of the line as well.
0
 
GaryCommented:
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

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now