Jump to content
xisto Community
Sign in to follow this  
-Sky-

Php Parse Error: Syntax Error

Recommended Posts

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/skyed211/public_html/main.php on line 30

Hey to all php coders on Trap.

I am in need of some help with a script/system I made out of .php. All I need is the PHP line for URLs instead of HTML, otherwise I get the Parse Error. >.< If anyone could help, I'd greatly appreciate it! :)

Share this post


Link to post
Share on other sites

We're going to need more than just the error message and the line number, as the location of the error isn't necessarily on the line given, and for other obvious reasons.

Share this post


Link to post
Share on other sites

Well, not really. >.< It's copyright to me, and I don't want anyone "trying" to copy my code...people sort of like Ash. He likes to "copy and claim" things as his own made things. And I spent an hour and 50 minutes trying to correct alot of errors.

However, this is the part I get the error...

echo "Welcome to Central-Gaming.net! Please make your way to our echo "<a href="http://forums.central-gaming.net" target="_blank"><b>Community Forums</b></a>"; after you have logged in.";echo "Thank you.";if($session->logged_in){   echo "<h1>Logged In</h1>";   echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"	   ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>]   "	   ."[<a href=\"useredit.php\">Edit Account</a>]   ";   if($session->isAdmin()){	  echo "[<a href=\"admin/admin.php\">Admin Panel</a>]   ";   }   echo "[<a href=\"process.php\">Logout</a>]";}else{?>

Share this post


Link to post
Share on other sites

Here's a fixed version that works. Your echo at the top was wrong:

<?phpecho "Welcome to Central-Gaming.net! Please make your way to our ";echo "<a href=\"forums.central-gaming.net; target=\"_blank\"><b>Community Forums</b></a> ";echo "after you have logged in. ";echo "Thank you.";if(true){ echo "<h1>Logged In</h1>"; echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>]   " ."[<a href=\"useredit.php\">Edit Account</a>]   "; if(true){ echo "[<a href=\"admin/admin.php\">Admin Panel</a>]   "; } echo "[<a href=\"process.php\">Logout</a>]";}?>
EDIT: You can make all those echo statements at the top one statement. I just broke it up for readability's sake.Regards,z. Edited by OpaQue (see edit history)

Share this post


Link to post
Share on other sites

Woah, thank you ever so much zak! It worked. :DNow for the big request. (Hope you can handle it.)I have a little homepage made out of pure HTML and some CSS. I'd like my HTML page to be coded into my .php "main.php" file, so it has some color and background. Could you help me with this? :) Thanks to everyone who has offered and replied with the appropriate support. :P

Share this post


Link to post
Share on other sites

I have a little homepage made out of pure HTML and some CSS. I'd like my HTML page to be coded into my .php "main.php" file, so it has some color and background. Could you help me with this? :) Thanks to everyone who has offered and replied with the appropriate support. :P

The statement doesn't seem to be implying the use of the include statement, so i think you may be interested in the HTML heredoc. For example:
echo <<<HTML<!-- insert HTML code here -->HTML;
The HTML heredoc allows you to include PHP variables within them without having to worry about escaping double quotes for the HTML.

Share this post


Link to post
Share on other sites
parse errorPhp Parse Error: Syntax Error

Hi I recently tried to upload a new site onto 000.Webhost.Com I used FTP in dreamweaver with no problems. When I tried to view the site I got this message:Parse error: syntax error, unexpected T_STRING in /home/a1823608/public_html/index.Htm on line 1After a little research it seems that this is a php error but I designed my site using html with css. Can you give me some insight on how to fix this. I contacted their support desk and they told me:"Hello,You probably have mismatched quotes/parentheses/etc or left off a semi colon or something like that after editing the file.Many Thanks,Helpdesk Staff https://www.000webhost.com/ nope I didn't leave anything out at all. I'm about ready to throw in the towel and go buy my spaceHope someone can help!

-question by Ryan

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.