PHP unexpected T_CONSTANT_ENCAPSED_STRING HELP!

Well, I think my script is valid, but it returns various unexpected T_CONSTANT_ENCAPSED_STRINGs...

Here it is, all my points to anyone who can help...

<?php

$iconnumbertwo = $iconnumber - 1;

print ("<html><head><title></title><link rel=stylesheet href='css1.css' type='text/css'></head><body><center><?php include 'topbanner.php'; ?><?php include 'leftmenu.php'; ?><td valign='top'><table width='500' border='0'><?php include 'iconsnav.php'; ?><tr><td class='regulartitle'>");

print ("Icons: $bandname [$iconnumber]");

print ("</td><tr><td class='newstbl'>");

while ($iconnumber > 0)
{

$iconnumbertwo = $iconnumbertwo - 1;
print ("<a href='aim:BuddyIcon?src=http://www.punkaim.com/theicons/");
print ($abrev);
print ($iconnumertwo);
print (".gif'>");
print ("<img src='http://www.punkaim.com/theicons/');
print ($abrev);
print ($iconnumertwo);
print ("'.gif'")
print ("border='0'></a>");

}

print ("</td></td></tr></table>");
print ("</td><?php include 'rightmenu.php'; ?>");
print ("<?php include 'bottompage.php'; ?>");
print ("</body></html>");


?>
doctacrazyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

__macro__Commented:
You need read more about issue the tags <?php  ?>
Good example:
<?php
if ($expression) {
   ?>
   <strong>This is true.</strong>
   <?php
} else {
   ?>
   <strong>This is false.</strong>
   <?php
}
?>


This works as expected, because when PHP hits the ?> closing tags, it simply starts outputting whatever it finds until it hits another opening tag.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
carchitectCommented:
which line sir
0
bcouldreyCommented:
Change your last 4 lines

FROM:
print ("</td></td></tr></table>");
print ("</td><?php include 'rightmenu.php'; ?>");
print ("<?php include 'bottompage.php'; ?>");
print ("</body></html>");


TO:
print ("</td></td></tr></table>");
print ("</td>");
include 'rightmenu.php';
include 'bottompage.php';
print ("</body></html>");



\Ben.



0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

JonzaCommented:
yup, that should solve your problem.
you cant use PHP inside PHP =)

also change this:
print ("<html><head><title></title><link rel=stylesheet href='css1.css' type='text/css'></head><body><center><?php include 'topbanner.php'; ?><?php include 'leftmenu.php'; ?><td valign='top'><table width='500' border='0'><?php include 'iconsnav.php'; ?><tr><td class='regulartitle'>");


to this:
print ("<html><head><title></title><link rel=stylesheet href='css1.css' type='text/css'></head><body><center>");
include 'topbanner.php';
include 'leftmenu.php';
print("<td valign='top'><table width='500' border='0'>");
include 'iconsnav.php';
print("<tr><td class='regulartitle'>");
0
JonzaCommented:
oh.. and the include statements..
use them like this:
include("topbanner.php");
instead of this:
include "topbanner.php";  //may be the problem on some servers

make these corrections that i gave to your script and the one that bcouldrey gave to make your script work :)
0
Richard QuadlingSenior Software DeveloperCommented:
Another interpretation of all of the above.

Note the use of the heredoc code (<<<), this can assist in making your ' and " usage a LOT easier!!!

<html>
<head>
<title></title>
<link rel="stylesheet" href="css1.css" type="text/css">
</head>
<body>
<center>
<?php
$iconnumbertwo = $iconnumber - 1;

include ('topbanner.php');
include ('leftmenu.php');

echo<<<END_HTML
<td valign="top">
<table width="500" border="0">

END_HTML;

include ('iconsnav.php');

echo<<<END_HTML
<tr><td class="regulartitle">Icons: {$bandname} [{$iconnumber}]</td><tr><td class="newstbl">
END_HTML;

while ($iconnumber > 0)
     {
     $iconnumbertwo = $iconnumbertwo - 1;
     echo<<<END_HTML
<a href="aim:BuddyIcon?src=http://www.punkaim.com/theicons/{$abrev}{$iconnumertwo}.gif"><img src="http://www.punkaim.com/theicons/{$abrev}{$iconnumertwo}.gif" border="0"></a>
END_HTML;
     }

echo<<<END_HTML
</td></td></tr></table></td>
END_HTML;

include ('rightmenu.php');
include ('bottompage.php');

?>
</body>
</html>

Regards,

Richard.
0
Richard QuadlingSenior Software DeveloperCommented:
And watch out for the spelling mistake of $iconnumertwo in the <a> tag. Sorry.

Oh. Just noticed you mispelled them too! Ha!

Richard.

<html>
<head>
<title></title>
<link rel="stylesheet" href="css1.css" type="text/css">
</head>
<body>
<center>
<?php
$iconnumbertwo = $iconnumber - 1;

include ('topbanner.php');
include ('leftmenu.php');

echo<<<END_HTML
<td valign="top">
<table width="500" border="0">

END_HTML;

include ('iconsnav.php');

echo<<<END_HTML
<tr><td class="regulartitle">Icons: {$bandname} [{$iconnumber}]</td><tr><td class="newstbl">
END_HTML;

while ($iconnumber > 0)
     {
     $iconnumbertwo = $iconnumbertwo - 1;
     echo<<<END_HTML
<a href="aim:BuddyIcon?src=http://www.punkaim.com/theicons/{$abrev}{$iconnumbertwo}.gif"><img src="http://www.punkaim.com/theicons/{$abrev}{$iconnumbertwo}.gif" border="0"></a>
END_HTML;
     }

echo<<<END_HTML
</td></td></tr></table></td>
END_HTML;

include ('rightmenu.php');
include ('bottompage.php');

?>
</body>
</html>
0
Richard QuadlingSenior Software DeveloperCommented:
Abandoned! Abandoned!!! After all this excellent work!!!! Jees! You'd think we would get an award of SOMETHING!!!! <grin> "I'd just like to thank my mum and my dad and my cats and the nextdoor neighbour's goldfish salesmen's car washer for all their help and inspiration! <blub> I never <blub> expected <blub> <blub> ..." (Led away in tears! Ed.)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.