Jump to content

Unexpected << where I have my <<<_END construct


SteelyDan
Go to solution Solved by SteelyDan,

Recommended Posts

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)

Link to comment
Share on other sites

  • Solution

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)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.