cscartman
03-01-2003, 12:42 PM
Please take a look at this script for a virtual pet shop i cant figure out were the error is :( please help its included in a zip file
|
Click to See Complete Forum and Search --> : PHP/Msql Help! cscartman 03-01-2003, 12:42 PM Please take a look at this script for a virtual pet shop i cant figure out were the error is :( please help its included in a zip file pyro 03-01-2003, 12:46 PM Could you post the error that you are getting please? cscartman 03-01-2003, 12:55 PM Parse error: parse error, expecting `','' or `';'' in /home/codeman/public_html/setroo/shops.php on line 42 pyro 03-01-2003, 01:03 PM line 42 looks like this: echo "<center><font face=verdana size=4><b>Shop: <?php "$row[shop_name]";?></b></font><br>"; when it should look like: echo "<center><font face=verdana size=4><b>Shop: $row[shop_name]</b></font><br>"; and you've got a bunch more similar errors... cscartman 03-01-2003, 01:27 PM Yea i have an other error and im kinda new to php i fixed a couple i think its on line 52 now if you want u can help out and download it agian the new one jpmoriarty 03-01-2003, 01:40 PM man your code's shocking - people dont mind helping out if you're stuck, but i think you'll find people are fairly unwilling to help if you're just too lazy to check your code yourself. The error is telling you which line the problem is on, so have a look at it and see what you're doing with your code. In this case we have: echo "<center><a href=shops.php?action=buy&id=$row[itemID]&p=$row[item_price]<img src="/setropets/items/<? $row[pic_name] ?>.jpg"><br>"; So, where to start. You start your echo and open it with quotes, so when it gets to your <img src-" bit it's thinking that the " is closing the echo quote. So you have to slash it out with a \. what that does is tell the php engine that the character that comes next should be ignored by the engine. That way, it echo's out the character but carries on echoing out the line. Then for some reason, despite already being in php mode, you try to go into php mode again. The line should read: echo "<center><a href=shops.php?action=buy&id=$row[itemID]&p=$row[item_price]<img src=\"/setropets/items/$row[pic_name].jpg\"><br>"; I'll warn you that that's not going to help matters much though - you need to just go through, correct each mistake in turn (like for example a few lines later on you have a } for no apparent reason. Take more care in your code, and then take the time to look for obvious mistakes when they're pointed out to you by the php engine. And it's not good form to just whack up and entire script and expect someone else to wade through it to spot all your mistakes - come with genuine problems and gripes and you'll get plenty of help. Also, you may want to check out www.phpbuilder.com/forum for a dedicated php forum. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |