Jump to content

Archived

This topic is now archived and is closed to further replies.

JackJack

Error

Recommended Posts

Hi Could You Please Help

I Get The Error

Parse error: syntax error, unexpected '<' in /***************************/battlemachines.net/test/rps.php on line 16

the code is
<?php


$computer = rand('rock','paper','scissors');


$action = $_POST[action];


if ($action == 'rock' && $computer == 'rock') {

echo "No one wins";
exit;
}

<a href='rps.php?action=rock'><img src='http://www.battlemachines.net/test/rock.bmp'></a>
<br>
<a href='rps.php?action=paper'><img src='http://www.battlemachines.net/test/paper.bmp'></a>
<br>
<a href='rps.php?action=scissors'><img src='http://www.battlemachines.net/test/scissors.bmp'></a>


?>

Thank you for your help

JackJack

Share this post


Link to post
Share on other sites
[b]DO NOT PM MEMBERS ABOUT YOUR THREADS WHEN YOU JUST POSTED THEM.[/b]

Share this post


Link to post
Share on other sites
[!--quoteo(post=360090:date=Mar 30 2006, 08:42 PM:name=JackJack)--][div class=\'quotetop\']QUOTE(JackJack @ Mar 30 2006, 08:42 PM) [snapback]360090[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi Could You Please Help

I Get The Error

Parse error: syntax error, unexpected '<' in /***************************/battlemachines.net/test/rps.php on line 16
[/quote]
Try
[code]
<?php
$computer = rand('rock','paper','scissors');
$action = $_POST[action];
if ($action == 'rock' && $computer == 'rock') {
echo "No one wins";
exit;
}
?>
<a href='rps.php?action=rock'><img src='http://www.battlemachines.net/test/rock.bmp'></a>
<br>
<a href='rps.php?action=paper'><img src='http://www.battlemachines.net/test/paper.bmp'></a>
<br>
<a href='rps.php?action=scissors'><img src='http://www.battlemachines.net/test/scissors.bmp'></a>
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.