Jump to content


Photo

Error


  • Please log in to reply
2 replies to this topic

#1 JackJack

JackJack
  • Members
  • PipPipPip
  • Advanced Member
  • 38 posts

Posted 30 March 2006 - 06:42 PM

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

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 30 March 2006 - 06:43 PM

DO NOT PM MEMBERS ABOUT YOUR THREADS WHEN YOU JUST POSTED THEM.

Info: PHP Manual


#3 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 30 March 2006 - 06:57 PM

[!--quoteo(post=360090:date=Mar 30 2006, 08:42 PM:name=JackJack)--][div class=\'quotetop\']QUOTE(JackJack @ Mar 30 2006, 08:42 PM) View Post[/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
<?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>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users