Forum Moderators: coopster

Message Too Old, No Replies

Parse error: syntax error, unexpected T STRING in /home/printt5/public

         

cpirt

2:15 pm on Feb 7, 2010 (gmt 0)

10+ Year Member



I get the error Parse error: syntax error, unexpected T_STRING in /home/printt5/public_html/ptmanuals/edu/apdx-faq.html on line 1

And I dont know why a sample of my code is


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

midtempo

2:35 pm on Feb 7, 2010 (gmt 0)

10+ Year Member



what includes or code are you running before you send the headers?

cpirt

2:42 pm on Feb 7, 2010 (gmt 0)

10+ Year Member



<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix B. Troubleshooting & Technical FAQ's</title><link rel="stylesheet" href="styles_html.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /><link rel="start" href="index.html" title="Print Trac Educational 3.6 User Manual" /><link rel="up" href="index.html" title="Print Trac Educational 3.6 User Manual" /><link rel="prev" href="apdx-tools-installer-options.html" title="Automating / Streamlining Installation on Windows" /><link rel="next" href="apdx-ldap.html" title="Appendix C. Advanced LDAP Configuration" /><script xmlns="" type="text/javascript" src="scripts/common.js"></script></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. Troubleshooting & Technical FAQ's</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apdx-tools-installer-options.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apdx-ldap.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="apdx-faq"></a>Appendix B. Troubleshooting & Technical FAQ's</h2></div></div></div><p>

midtempo

2:56 pm on Feb 7, 2010 (gmt 0)

10+ Year Member



okay, this is the output for the web page's header (and content).

what i'm not seeing is any php type code that would throw an error.

what (i think) is happening is that there are some files being included *before* the html markup. one of these will have the problem

and it's (generally) an easy problem to fix.

don't know how experienced you are with php, so i'm going to say things as clearly as i can... forgive me if i'm telling you stuff you already know.

what is missing is either:

a) a semi-colon at the end of a line of php code
b) a closing quote, i.e you've got a " somewhere and there isn't a corresponding closing "
c) a closing curly bracket, } - i.e. there a { and not a corresponding }

what you need to do is identify what the system is doing *before* it loads the page contents. generally it's stuff like log in permissions, configuration details and the like.

you need to find these pages and load them into a text editor which can cope with php coding. there's loads around.

it *should* then show you where and what error is causing your page to fall over.

good luck

rocknbil

8:09 pm on Feb 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard cpirt,

I get the error Parse error: syntax error, unexpected T_STRING in /home/printt5/public_html/ptmanuals/edu/apdx-faq.html on line 1


This is most often a missing quote or some place it's expecting a variable, but in your case, it's something else. Look at your first line.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

It's parsing it as a PHP short tag. :-) Two way to go here:

1. If this is **NOT** an XML document, just remove this line completely. You don't need to declare the document as XML even with an XHTML doctype. You're probably not even extending the HTML set, so can drop to a 4.+ doctype, or use HTML 5, but that's not related to the question.

2. If you **NEED** an xml declaration, echo this line. It's a bit of a work around, but should do the trick:

<?php echo '<?xml version="1.0" encoding="UTF-8" standalone="no"?>';?>

Might have to escape the ?'s inside the quotes, might not.

midtempo

9:12 pm on Feb 7, 2010 (gmt 0)

10+ Year Member



doh. of course.

sorry for putting you on the wrong track.