Helpen

Gestart doorShahiem7 reacties33 weergaven

8 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb een Steenpapier schaar spel gevonden maar nu wil ik weten hoe ik het verder kan beveiligen en als je gewonnen hebt dat je muntjes krijgt.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Rock, Paper, scissors</title>
</head>

<body>
<center>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])){[/COLOR]

   [COLOR= #0000BB]$actions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"paper"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"rock"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"scissors"[/COLOR][COLOR= #007700]);[/COLOR]
   [COLOR= #0000BB]$mogelijkheden[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"paper"[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"rock"[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"scissors"[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]4[/COLOR][COLOR= #007700]);[/COLOR]
  
   [COLOR= #0000BB]$speler[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mogelijkheden[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rps[/COLOR][COLOR= #007700]]];[/COLOR]
  
   [COLOR= #0000BB]$c[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$actions[/COLOR][COLOR= #007700][[/COLOR][URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700])];[/COLOR]
   [COLOR= #0000BB]$comp[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mogelijkheden[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$c[/COLOR][COLOR= #007700]];[/COLOR]
  
   [COLOR= #0000BB]$gewonnen[/COLOR] [COLOR= #007700]= ((([/COLOR][COLOR= #0000BB]$speler[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]$comp[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$comp[/COLOR] / [COLOR= #0000BB]$speler[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]0.5[/COLOR][COLOR= #007700]) ||[/COLOR] [COLOR= #0000BB]$speler[/COLOR] / [COLOR= #0000BB]$comp[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]0.5[/COLOR][COLOR= #007700]) &&[/COLOR] [COLOR= #0000BB]$comp[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$speler[/COLOR][COLOR= #007700]);[/COLOR]


   [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$gewonnen[/COLOR][COLOR= #007700]){[/COLOR]
    ?>
    <font color="green">
      Je hebt gewonnen!<br />
      Gefeliciteerd
    </font>
  [COLOR= #0000BB]<?php[/COLOR]
  [COLOR= #007700]}[/COLOR]
  [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$speler[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]$comp[/COLOR][COLOR= #007700]){[/COLOR]
      ?>
    Jullie hadden dezelfde actie,<br />
    Gelijkspel
    [COLOR= #0000BB]<?php[/COLOR]
  [COLOR= #007700]}[/COLOR]
  [URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
      ?>
    <font color="red">Je hebt verloren!</font>
    [COLOR= #0000BB]<?php[/COLOR]
  [COLOR= #007700]}[/COLOR]

?>
<br /><br />
<table>
  <tr>
    <td width="50%">Jouw actie:</td>
    <td><?=ucfirst($_POST[rps]); ?></td>
  </tr>
  <tr>
    <td>Pc actie:</td>
    <td><?=ucfirst($c); ?></td>
  </tr>
</table>
<br /><br />
<a href="<?=$_SERVER[HTTP_REFERER]; ?>">Begin opnieuw</a>
[COLOR= #0000BB]<?php[/COLOR]
  [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
}[/COLOR]
?>
Welkom bij Rock, paper, scissors<br />
<br />
<table>
<form name="rps" action="?action" method="post">
<tr>
  <td><input type="radio" name="rps" value="paper" /></td>
  <td align="left">Paper</td>
</tr>
<tr>
  <td width="50%"><input type="radio" name="rps" value="rock" /></td>
  <td align="left">Rock</td>
</tr>
<tr>
  <td><input type="radio" name="rps" value="scissors" /></td>
  <td align="left"><label for="scissors">Scissors</label></td>
</tr>
<tr>
  <td colspan="2"><input type="submit" name="submit" value="Strijd" /></td>
</tr>
</form>
</table>
</center>
</body>
</html>


Je krijgt er een vergoeding voor.
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
BUMPyummie
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
als er enters inzaten kunnen we beter helpen
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Veranderdbiggrin
0
Krm

Lid

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
regel 10 tot en met 43

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])){[/COLOR]

   [COLOR= #0000BB]$actions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"paper"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"rock"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"scissors"[/COLOR][COLOR= #007700]);[/COLOR]
   [COLOR= #0000BB]$mogelijkheden[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"paper"[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"rock"[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"scissors"[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]4[/COLOR][COLOR= #007700]);[/COLOR]
  
   [COLOR= #0000BB]$speler[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mogelijkheden[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rps[/COLOR][COLOR= #007700]]];[/COLOR]
  
   [COLOR= #0000BB]$c[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$actions[/COLOR][COLOR= #007700][[/COLOR][URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700])];[/COLOR]
   [COLOR= #0000BB]$comp[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mogelijkheden[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$c[/COLOR][COLOR= #007700]];[/COLOR]
  
   [COLOR= #0000BB]$gewonnen[/COLOR] [COLOR= #007700]= ((([/COLOR][COLOR= #0000BB]$speler[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]$comp[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$comp[/COLOR] / [COLOR= #0000BB]$speler[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]0.5[/COLOR][COLOR= #007700]) ||[/COLOR] [COLOR= #0000BB]$speler[/COLOR] / [COLOR= #0000BB]$comp[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]0.5[/COLOR][COLOR= #007700]) &&[/COLOR] [COLOR= #0000BB]$comp[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$speler[/COLOR][COLOR= #007700]);[/COLOR]


   [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$gewonnen[/COLOR][COLOR= #007700]){[/COLOR]
    
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<font color="green">[/COLOR][COLOR= #007700];[/COLOR]
   [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR]Je hebt gewonnen[COLOR= #007700]!<[/COLOR]br /[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
   echo [/COLOR]Gefeliciteerd[COLOR= #007700]<[/COLOR]/font[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
   mysql_query("UPDATE users SET kliks = kliks + 1 WHERE user = ".$_SESSION[user]."");

  }
  elseif($speler == $comp){
   echo [/COLOR] Jullie hadden dezelfde actie[COLOR= #007700],<[/COLOR]br /[COLOR= #007700]>[/COLOR][COLOR= #DD0000];
   echo [/COLOR] Gelijkspel[COLOR= #DD0000];
  }
  else{
    echo font color="red">Je hebt verloren!</font>[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE users SET kliks = kliks - 1 WHERE user = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
  }[/COLOR]

?>
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedanktbiggrin
0
Krm

Lid

Berichten
6.235
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
alsje querys wel veraneren (maar dat snapte je vast al)
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kerem:
alsje querys wel veraneren (maar dat snapte je vast al)

Jep , Dacht er niet bij naemo
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren