Paldo Posted November 1, 2009 Share Posted November 1, 2009 Hi I didn't use PHP for some time and now I can't figure out how to solve a simple stuff. Please have a look in my source and give me a hint... Thanks It prints that there is a parse error, expecting `','' or `';'' in /3w/euweb.cz/p/parobek/katarm.php on line 51 what is the line where body starts. <html> <head> <title> ÄŽurkoviÄŤ </title> <style type="text/css"> a {text-decoration: none} a:link {color: #c1c1c1; font-style: bold; background-image: url('button_blank.JPG') } a:visited {color: #c1c1c1; font-style: bold; background-image: url('button_blank.JPG') } a:active {color: #c1c1c1; font-style: bold; background-image: url('button_blank.JPG') } a:hover {color: white; font-style: bold; text-decoration: none; background-image: url('button_aktiv.JPG') } </style> <SCRIPT language="javascript1.1"> gifHome = new Image(54,18) gifHome.src = "button_ofirme.png" gifHome2 = new Image(54,18) gifHome2.src = "button_ofirmeakt.png" gifproduk = new Image(54,18) gifproduk.src = "button_produktynakt.png" gifproduk2 = new Image(54,18) gifproduk2.src = "button_produkty.png" gifsluz = new Image(54,18) gifsluz.src = "button_sluzby.png" gifsluz2 = new Image(54,18) gifsluz2.src = "button_sluzbyakt.png" gifref = new Image(54,18) gifref.src = "button_referencie.png" gifref2 = new Image(54,18) gifref2.src = "button_referencieakt.png" gifkon = new Image(54,18) gifkon.src = "button_kontakt.png" gifkon2 = new Image(54,18) gifkon2.src = "button_kontaktakt.png" gifdom = new Image(54,18) gifdom.src = "button_domov.png" gifdom2 = new Image(54,18) gifdom2.src = "button_domovakt.png" function changeImg(cImg,ref) { document.images[cImg].src = ref.src } </SCRIPT> </head> <body> <?php echo '<body bgcolor='black'>'; echo'<div align="center" style='position:absolute; left:0%; right:0%; top:0%; height: 800px; width: 1280px; text-align: center; margin: 0 auto; z-index: 0'>'; echo' <img src='podklad.jpg' width="1280" height="800">'; echo'<div style="position: absolute; left: 248px; top: 125px">'; echo'<img border="0" src="lista.png" > '; echo'<div align="center" style="position: absolute; left: 140pxef; top: 9px">'; echo' <a href="durky.html" onMouseOver="changeImg('imgofirme',gifHome2)" onMouseOut="changeImg('imgofirme',gifHome)" > <img border="0" src="button_ofirme.png" name="imgofirme" ></a>'; echo'<div style="position: absolute; left: 90px; top: 0px">'; echo' <a href="produkty.html" onMouseOver="changeImg('imgprod',gifproduk2)" onMouseOut="changeImg('imgprod',gifproduk)" > <img border="0" src="button_produktynakt.png" name="imgprod" > </a> echo'<div style="position: absolute; left: 90px; top: 0px">'; echo' <a href="sluzby.html" onMouseOver="changeImg('imgsluz',gifsluz2)" onMouseOut="changeImg('imgsluz',gifsluz)" > <img border="0" src="button_sluzby.png" name="imgsluz" > </a> '; echo'<div style="position: absolute; left: 72px; top: 0px">'; echo' <a href="refer.html" onMouseOver="changeImg('imgref',gifref2)" onMouseOut="changeImg('imgref',gifref)" > <img border="0" src="button_referencie.png" name="imgref" > </a> '; echo'<div style="position: absolute; left: 95px; top: 0px">'; echo' <a href="kontakt.html" onMouseOver="changeImg('imgkon',gifkon2)" onMouseOut="changeImg('imgkon',gifkon)" > <img border="0" src="button_kontakt.png" name="imgkon" > </a> '; echo'<div style="position: absolute; left: 80px; top: 0px; text-align: left">'; echo'<a onMouseOver="changeImg('imgdom',gifdom2)" onMouseOut="changeImg('imgdom',gifdom)" href="durky.html" > <img border="0" src="button_domov.png" name="imgdom" > </a> '; echo'</div>'; ?> </html> Link to comment https://forums.phpfreaks.com/topic/179822-parse-error-please-help/ Share on other sites More sharing options...
herghost Posted November 1, 2009 Share Posted November 1, 2009 If your echo rows start with ' then everything you define in these rows before the closing ' cannot be an '. Try using " instead ie echo '<body bgcolor="black">'; Link to comment https://forums.phpfreaks.com/topic/179822-parse-error-please-help/#findComment-948665 Share on other sites More sharing options...
Paldo Posted November 1, 2009 Author Share Posted November 1, 2009 Ok thanks, I fixed that and a coupple of other " and ' but it still prints the same error but this time on a line 61. I'll mark up the line in my code. I could use any help. Thanks. <html> <head> <title> ÄŽurkoviÄŤ </title> <style type="text/css"> a {text-decoration: none} a:link {color: #c1c1c1; font-style: bold; background-image: url('button_blank.JPG') } a:visited {color: #c1c1c1; font-style: bold; background-image: url('button_blank.JPG') } a:active {color: #c1c1c1; font-style: bold; background-image: url('button_blank.JPG') } a:hover {color: white; font-style: bold; text-decoration: none; background-image: url('button_aktiv.JPG') } </style> <SCRIPT language="javascript1.1"> gifHome = new Image(54,18) gifHome.src = "button_ofirme.png" gifHome2 = new Image(54,18) gifHome2.src = "button_ofirmeakt.png" gifproduk = new Image(54,18) gifproduk.src = "button_produktynakt.png" gifproduk2 = new Image(54,18) gifproduk2.src = "button_produkty.png" gifsluz = new Image(54,18) gifsluz.src = "button_sluzby.png" gifsluz2 = new Image(54,18) gifsluz2.src = "button_sluzbyakt.png" gifref = new Image(54,18) gifref.src = "button_referencie.png" gifref2 = new Image(54,18) gifref2.src = "button_referencieakt.png" gifkon = new Image(54,18) gifkon.src = "button_kontakt.png" gifkon2 = new Image(54,18) gifkon2.src = "button_kontaktakt.png" gifdom = new Image(54,18) gifdom.src = "button_domov.png" gifdom2 = new Image(54,18) gifdom2.src = "button_domovakt.png" function changeImg(cImg,ref) { document.images[cImg].src = ref.src } </SCRIPT> </head> <body> <?php echo '<body bgcolor="black">'; echo'<div align="center" style="position:absolute; left:0%; right:0%; top:0%; height: 800px; width: 1280px; text-align: center; margin: 0 auto; z-index: 0">'; echo' <img src="podklad.jpg" width="1280" height="800">'; // [b]THIS IS THE LINE ERROR REFERS TO[/b] echo'<div style="position: absolute; left: 248px; top: 125px">'; echo'<img border="0" src="lista.png" > '; echo'<div align="center" style="position: absolute; left: 140pxef; top: 9px">'; echo' <a href="durky.html" onMouseOver="changeImg('imgofirme',gifHome2)" onMouseOut="changeImg('imgofirme',gifHome)" > <img border="0" src="button_ofirme.png" name="imgofirme" ></a>'; echo'<div style="position: absolute; left: 90px; top: 0px">'; echo' <a href="produkty.html" onMouseOver="changeImg('imgprod',gifproduk2)" onMouseOut="changeImg('imgprod',gifproduk)" > <img border="0" src="button_produktynakt.png" name="imgprod" > </a> echo'<div style="position: absolute; left: 90px; top: 0px">'; echo' <a href="sluzby.html" onMouseOver="changeImg('imgsluz',gifsluz2)" onMouseOut="changeImg('imgsluz',gifsluz)" > <img border="0" src="button_sluzby.png" name="imgsluz" > </a> '; echo'<div style="position: absolute; left: 72px; top: 0px">'; echo' <a href="refer.html" onMouseOver="changeImg('imgref',gifref2)" onMouseOut="changeImg('imgref',gifref)" > <img border="0" src="button_referencie.png" name="imgref" > </a> '; echo'<div style="position: absolute; left: 95px; top: 0px">'; echo' <a href="kontakt.html" onMouseOver="changeImg('imgkon',gifkon2)" onMouseOut="changeImg('imgkon',gifkon)" > <img border="0" src="button_kontakt.png" name="imgkon" > </a> '; echo'<div style="position: absolute; left: 80px; top: 0px; text-align: left">'; echo'<a onMouseOver="changeImg('imgdom',gifdom2)" onMouseOut="changeImg('imgdom',gifdom)" href="durky.html" > <img border="0" src="button_domov.png" name="imgdom" > </a> '; echo'</div>'; ?> </html> Link to comment https://forums.phpfreaks.com/topic/179822-parse-error-please-help/#findComment-948759 Share on other sites More sharing options...
jefffan24 Posted November 1, 2009 Share Posted November 1, 2009 in front of the ; put a \ to ignore the ;. i don't know if this the error but it might be considering the line to end when it sees the ; even though it is in the '. Link to comment https://forums.phpfreaks.com/topic/179822-parse-error-please-help/#findComment-948761 Share on other sites More sharing options...
kenrbnsn Posted November 1, 2009 Share Posted November 1, 2009 Why are you even using PHP in that code? You're not using any PHP in the code except for "echo". Just write it a plain HTML. Ken Link to comment https://forums.phpfreaks.com/topic/179822-parse-error-please-help/#findComment-948796 Share on other sites More sharing options...
ldb358 Posted November 1, 2009 Share Posted November 1, 2009 its the stuff that your passing to the javascript function for example: onMouseOver="changeImg('imgofirme',gifHome2)" you need to escape the ' with \ Link to comment https://forums.phpfreaks.com/topic/179822-parse-error-please-help/#findComment-948799 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.