Solved

PHP Code Help Neded

Posted on 2014-07-21
4
260 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
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 34

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

895 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

14 Experts available now in Live!

Get 1:1 Help Now