tomfmason Posted June 25, 2006 Share Posted June 25, 2006 I am sure that this is a simple syntax error but I get the following error when I run my test.php script:[b]Parse error[/b]: parse error, unexpected '<' in [b]C:\htdocs\users\www\owpt\header.php[/b] on line 2here is my header.php file:[code]<?php<div class="fixcenter"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td valign="middle"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="770" height="200" align="top"> <param name="movie" value="/images/header.swf"> <param name="quality" value="high"><param name="LOOP" value="false"> <embed src="images/header.swf" width="790" height="200" loop="false" align="top" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object> </td> </tr></table>?>[/code]I am knew to php and realy have no idea if I am doing this right. Any Ideas would be great. Quote Link to comment https://forums.phpfreaks.com/topic/12866-unexpected/ Share on other sites More sharing options...
hitman6003 Posted June 25, 2006 Share Posted June 25, 2006 Remove the <?php and ?> from the beginning and end of your file. Or, put an echo statement around all of your html.There is no php in there, but you have it wrapped in php tags. Quote Link to comment https://forums.phpfreaks.com/topic/12866-unexpected/#findComment-49368 Share on other sites More sharing options...
tomfmason Posted June 25, 2006 Author Share Posted June 25, 2006 I followed the [a href=\"http://www.phpfreaks.com/tutorials/8/1.php\" target=\"_blank\"]Theme Tutorial[/a]. And yet I get this same error with the footer Quote Link to comment https://forums.phpfreaks.com/topic/12866-unexpected/#findComment-49376 Share on other sites More sharing options...
johnnyk Posted June 26, 2006 Share Posted June 26, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php<div class="fixcenter"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td valign="middle"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="770" height="200" align="top"> <param name="movie" value="/images/header.swf"> <param name="quality" value="high"><param name="LOOP" value="false"> <embed src="images/header.swf" width="790" height="200" loop="false" align="top" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object> </td> </tr></table>?>[/quote]Your page doesn't have any actual PHP in it. All it is is HTML with a "<?php" before it and a "?>" after it.You could do one of the following to make it display correctly, without the warning:1. Eliminate the <?php and ?>. Since there is no PHP contained within them, they serve no purpose[code]<div class="fixcenter"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td valign="middle"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="770" height="200" align="top"> <param name="movie" value="/images/header.swf"> <param name="quality" value="high"><param name="LOOP" value="false"> <embed src="images/header.swf" width="790" height="200" loop="false" align="top" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object> </td> </tr></table>[/code]2. Use echo to display the HTML[code]<?phpecho "<div class=\"fixcenter\">\n";echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n";...echo "</table>\n";?>[/code]The second one prints the HTML using PHP. The end result is exactly the same as the first one, making it pointless (unless you plan on adding PHP to the script later). If you echo a string ("<div class=\"fixcenter\">\n"), you have to escape the quotes that contain the string. So for this, since the string is contained in double quotes you have to escape all double quotes. That means you have to put a \ in front of any double quotes.\n is a line break. If you don't use that, all the HTML will be on the same line when the page is loaded. Quote Link to comment https://forums.phpfreaks.com/topic/12866-unexpected/#findComment-49515 Share on other sites More sharing options...
Drumminxx Posted June 26, 2006 Share Posted June 26, 2006 or you could just do this:[code]<?phpprint <<<END<div class="fixcenter"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td valign="middle"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="770" height="200" align="top"> <param name="movie" value="/images/header.swf"> <param name="quality" value="high"><param name="LOOP" value="false"> <embed src="images/header.swf" width="790" height="200" loop="false" align="top" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object> </td> </tr></table>END;?>[/code]but if your not going to write any php then it doesn't make sense. of course now the above code has some php in it [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/12866-unexpected/#findComment-49519 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.