ondi Posted December 16, 2008 Share Posted December 16, 2008 Hi, I'm trying to get an image to appear underneath my text (i.e. a table background image, but i keep getting the error code Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/fhlinux222/w/walthamforest-fc.co.uk/user/htdocs/stats/test.php on line 39 Could someone have a look at my snippet of code and see where im going wrong? Thanks echo"<center> <table><tr> <td align=\"center\"><table background="http://www.walthamforest-fc.co.uk/stats/nextmatch.jpg"> <img src=\"/stats/images/opponentlogo_$data[opp_id].jpg\"></td> </tr></table> $data[time]<br> $data[type]<br> $data[opp]<br> HOME - $data[stadium]<br> Kick off: $data[clock]<br><br> </center>"; Link to comment https://forums.phpfreaks.com/topic/137246-background-image-issues/ Share on other sites More sharing options...
Adam Posted December 16, 2008 Share Posted December 16, 2008 Problem is here.. <table background="http://www.walthamforest-fc.co.uk/stats/nextmatch.jpg"> Forgot to escape your quotes... <table background=\"http://www.walthamforest-fc.co.uk/stats/nextmatch.jpg\"> I've always found it much easier to use single quotes when echoing HTML. That way you don't have to escape the double quotes for every attribute... A Link to comment https://forums.phpfreaks.com/topic/137246-background-image-issues/#findComment-716979 Share on other sites More sharing options...
ondi Posted December 16, 2008 Author Share Posted December 16, 2008 Cheers A, that got rid of my error, but now the image wont show When i view the page source it says that the image is there, but i cant see it! Ho hum Link to comment https://forums.phpfreaks.com/topic/137246-background-image-issues/#findComment-716987 Share on other sites More sharing options...
ondi Posted December 16, 2008 Author Share Posted December 16, 2008 Any ideas guys? Link to comment https://forums.phpfreaks.com/topic/137246-background-image-issues/#findComment-717009 Share on other sites More sharing options...
premiso Posted December 16, 2008 Share Posted December 16, 2008 Copy the image url and paste it in your browser, see if it works. If it does not, chances are the URL is pointing to the wrong spot. Link to comment https://forums.phpfreaks.com/topic/137246-background-image-issues/#findComment-717065 Share on other sites More sharing options...
ondi Posted December 17, 2008 Author Share Posted December 17, 2008 Yup, the image works: http://www.walthamforest-fc.co.uk/stats/nextmatch.jpg But still nothing appears :'( Link to comment https://forums.phpfreaks.com/topic/137246-background-image-issues/#findComment-717213 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.