...

View Full Version : php parse error



surreal5335
07-22-2008, 06:02 PM
This is the error I am getting:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/surreal/public_html/index.php on line 51

This is what line 51 contains:



<table border="1" width="100%" style="background-image: url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-position: right bottom;">


Here is the page of code that I am trying to get to work from start to finish:




<?php
ini_set('display_errors','on');
error_reporting(E_ALL);
?>
<html>
<head>

<script language="javascript" type="text/javascript">


function rollOn(obj){
obj.src=obj.src.replace(/.png/,"blue.png");
}
function rollOff(obj){
obj.src=obj.src.replace(/blue.png/,".png");
}



var currentSpan = 1;
function showMe(n) {
document.getElementById("ex_"+currentSpan).style.display = "none";
document.getElementById("ex_"+n).style.display = "block";
currentSpan = n;
}

var currentDiv = 1;

function showcontent(n) {

// Hide the current side content that is being shown
document.getElementById("SC_"+currentDiv).style.display = "none";

// Show the new side content
document.getElementById("SC_"+n).style.display = "block";

// Set the current open side content
currentDiv = n;
}
/*this css code is to be entered into the first table tag just underneath the echo' function
style="background-image: url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-position: right bottom;"*/

</script>




</head>
<?php
echo'
<table border="1" width="100%" style="background-image: url('http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-position: right bottom;">
<tr>
<td>
<table width="100%" border="1">
<tr>
<td>
//header logo
</td>
</tr>
<tr>
<td>
//horizontal ad banner
</td>
</tr>
</table>';

require "renavbar.php";


require "rollcontent.php";

echo '
</td>
<td>
</td>
//vertical banner ad
</td>
</tr>
</table>
<table>
<tr>
<td>
//bottom navigation
<a href=" ">advertise</a>
<a href=" ">support</a>
<a href=" ">submit content</a>
<a href=" "></a>
<a href=" "></a>
</td>
</tr>
</table>';
?>


I took some html that has nothing to do with the problem to make it less cumbersome.

Thanks a lot for the help

ohgod
07-22-2008, 06:09 PM
posting half code is not useful.

ramm19
07-22-2008, 07:06 PM
you duplicated this thread... your problem is here:


url('http://i95.photobucket.com/albums/l136/surreal5335/RE&#37;20site/Fotolia_2695889_XS.jpg');

Replace it with this:


url(\'http://i95.photobucket.com/albums/l136/surreal5335/RE%20site/Fotolia_2695889_XS.jpg\');

surreal5335
07-22-2008, 10:44 PM
well that fixed it, I have no idea why the backslash was never mentioned in any other tutorial, but it worked.
Thanks a lot

djm0219
07-22-2008, 10:54 PM
The 4th example in the PHP manual on echo (http://us.php.net/manual/en/function.echo.php) shows how escaping is used.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum