LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-13-2013, 03:29 PM   #1
ashevillan
LQ Newbie
 
Registered: Mar 2013
Posts: 5

Rep: Reputation: Disabled
having trouble with php code giving a Parse error: syntax error, unexpected '>'


full error message:Parse error: syntax error, unexpected '>' in F:\CIS_115\Webserver\xampplite\htdocs\Webtech\coursework\Exam1\convertTemp.php on line 20
lines 19-22:
print ("<h1>$fahrenheit degrees F converts to $celsius degrees Celsius</h1>);
print ("<p> <a href=\"convertTemp.html"Convert another?</a> <a href=\"weather.html"\Todays Weather</a></p>");

?>
looked over it a million times and i cant find a extra > anywhere
 
Old 03-13-2013, 04:21 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
I don't know if this is it but, you don't have a closing double-quote in this line:

Code:
print ("<h1>$fahrenheit degrees F converts to $celsius degrees Celsius</h1>);
Typo here?
 
1 members found this post helpful.
Old 03-13-2013, 04:46 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Go look up the correct syntax for href statements plus check your quotes.

Quote:
print ("<p> <a href=\"convertTemp.html"Convert another?</a> <a href=\"weather.html"\Todays Weather</a></p>");
 
1 members found this post helpful.
Old 03-13-2013, 07:02 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Ditto ... check both lines for quotes as there are several missing. Also check where you have placed backslashes, one in particular will give a completely different look to the data.
 
1 members found this post helpful.
Old 03-13-2013, 09:27 PM   #5
ashevillan
LQ Newbie
 
Registered: Mar 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
thanks guys i see the quotes i missed and ditched the back slashes

print ("<h1>$fahrenheit degrees F converts to $celsius degrees Celsius</h1>");
print ("<p> <a href="convertTemp.html"Convert another? </a><a href="weather.html"Todays Weather</a></p>");

i am now getting an unexpected T_string error on line 20, the second of the two above^
 
Old 03-13-2013, 11:27 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
You still did not fix the syntax errors nor quotes in the second line.
 
Old 03-14-2013, 10:37 AM   #7
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Code:
 <a href="convertTemp.html"Convert another? </a>
maybe first take a look at the above and see if you can work out why this would be an invalid anchor? (hint: Why some of it in quotes and the other bit not?)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: syntax error, unexpected $end in /home/a7358914/public_html/index.php on nothing07 Programming 5 06-03-2012 02:11 PM
[SOLVED] What does "Parse error: syntax error, unexpected '}' in..." mean? Big trouble! smallcoldmoon Programming 2 08-03-2011 11:48 AM
Parse error: syntax error, unexpected '@' in php code minipro Programming 1 06-14-2011 04:33 AM
What is a Parse Error: syntax unexpected $end in Viewtopic_body.html.php sonia510 Programming 2 10-01-2009 04:43 PM
PHP Error Parse error: parse error, unexpected $ in /home/content/S/k/i/SkinCare4U/h CowanServices Programming 2 12-09-2008 08:26 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration