SteelyDan Posted July 27, 2013 Share Posted July 27, 2013 Hey guys, probably a nub question, but here it goes: Why am I getting the following error with my following code? Everything seems in place to me, I've looked it over a thousand times: ERROR: Parse error: syntax error, unexpected '<<' (T_SL) in C:\web\header.php on line 15 CODE: <?php //header.php include_once 'login_users.php'; session_start(); if (isset($_SESSION['username'])) { $username = $_SESSION['username']; $loggedin = TRUE; } else $loggedin = FALSE; if ($loggedin == TRUE) { echo <<<_END <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <style> body { margin: 0px 0px 0px 0px; } #table_header { display: block; height: 30px; margin-left: 0px; background-image:url('images/stripe_bg.jpg'); position: static; } #header_div { display: block; height: 10px; margin-left: 0px; background-image:url('images/greystripe_bg.jpg'); } .headertext { text-align: right; font-family: Colaborate-Thin; color: white; font-size: large; text-align: right; } .textab { font-family: Colaborate-Thin; text-align: right; color: #FFFFFF; </style> <title>Untitled 1</title> </head> <body> <table id="table_header" style="width: 100%"> </table> <div id="header_div"> </div> </body> </html> _END; } else { echo <<<_END <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <style> body { margin: 0px 0px 0px 0px; } #table_header { display: block; height: 30px; margin-left: 0px; background-image:url('images/stripe_bg.jpg'); position: static; } #header_div { display: block; height: 10px; margin-left: 0px; background-image:url('images/greystripe_bg.jpg'); } .headertext { text-align: right; font-family: Colaborate-Thin; color: white; font-size: large; text-align: right; } .auto-style1 { font-family: Colaborate-Thin; text-align: right; color: #FFFFFF; } .auto-style2 { color: #FFFFFF; } </style> <title>Untitled 1</title> </head> <body> <table id="table_header" style="width: 100%"> </table> <div id="header_div"> </div> </body> </html> _END; } ?> Thanks for your help! I've never seen this one before and have no idea where to begin looking. (Line 15, duh, but I feel like the syntax error is occuring somewhere else, lol) Quote Link to comment https://forums.phpfreaks.com/topic/280558-unexpected/ Share on other sites More sharing options...
SteelyDan Posted July 27, 2013 Author Share Posted July 27, 2013 Also, I googled it, and tried the solutions other people found (removing spaces before and after the _END as well as changing the name to not include and underscore at the beginning, nothing worked. Quote Link to comment https://forums.phpfreaks.com/topic/280558-unexpected/#findComment-1442358 Share on other sites More sharing options...
Solution SteelyDan Posted July 27, 2013 Author Solution Share Posted July 27, 2013 Got it--- Haha sorry for the triple post. This is all I had to do: if ($loggedin == TRUE) { echo <<<_END <html xmlns="http://www.w3.org/1999/xhtml"> <head> Just had to add return whitespace at the end of it. Who knew. Thanks! (lol) Quote Link to comment https://forums.phpfreaks.com/topic/280558-unexpected/#findComment-1442359 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.