Jump to content

Error


JackJack

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
Link to comment
https://forums.phpfreaks.com/topic/6197-error/
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]
Link to comment
https://forums.phpfreaks.com/topic/6197-error/#findComment-22377
Share on other sites

Archived

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

×
×
  • Create New...

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.