Honesty Rocks! truth rules.

Php Error-where To Put "?>"

HOME      >>       Programming

Eggie

lol....lately i have many problems in writing my scripts and i dont know if i should create post only for purpose so ppl can help me or should i create many post like i am doing right now...i am NOT making this to get many credits...i am doing it because i need help and many people here help me!

if ($_GET['action']!='race'){<form name="form2" method="get" action="race.php?action=race"><tr><td>Who do you wanna race?</td><td> <select size=5 name="bike"> <option value="Derbi Senda 50">Derbi Senda 50</option> <option value="Honda NS 50 R">Honda NS 50 R</option> <option value="Suzuki ZR 50">Suzuki ZR 50</option> <option value="Yamaha DT 50 MX">Yamaha DT 50 MX</option> <option value="Aprilia RS 50">Aprilia RS 50</option> </select>-<a href="java script:launchClasses()">?</a> <input type=submit value=Register> </td></tr></form>}
i have this code...if i put <?php before it and ?> after it i get

Parse error: syntax error, unexpected '<' in C:\wamp\www\race.php on line 27

if i put ?> directly after if clause like this
<?php if ($_GET['action']!='race')?>{//codes}
the brackets are printed out and it doesnt help...
and if i put it after like this:
<?php if ($_GET['action']!='race'){?>//codes}
i get this

Parse error: syntax error, unexpected $end in C:\wamp\www\race.php on line 41

i hope my problem is understandable and you can help me....thnx

vujsa

Try this:

if ($_GET['action']!='race'){?><form name="form2" method="get" action="race.php?action=race"><tr><td>Who do you wanna race?</td><td> <select size=5 name="bike"> <option value="Derbi Senda 50">Derbi Senda 50</option> <option value="Honda NS 50 R">Honda NS 50 R</option> <option value="Suzuki ZR 50">Suzuki ZR 50</option> <option value="Yamaha DT 50 MX">Yamaha DT 50 MX</option> <option value="Aprilia RS 50">Aprilia RS 50</option> </select>-<a href="java script:launchClasses()">?</a> <input type=submit value=Register> </td></tr></form><?php}?>

This is one of the nicest features available in PHP but can be very confusing at times if you forget what is an isn't going to be shown when.

By the way, don't worry about the multiple topics... As long as each is different, you can have a million topics! In fact, it is easier for later users to find information and discussion they want to participate in if the topics are separate. Not that you care, but from an SEO point of view, separate topics would score higher.

Hope this helps.

vujsa

Eggie

SOLVEDthanx vujsa..as i said i like this forum cause many people are willing to help and they get credits for it so thats great way for doing it...when i complete my game i hope my hosting will be approved at last ;)cya later with more questions to come...