Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('required.php');
- $database = new database;
- if(isset($_POST["submit"])){
- $result = $_POST["game"];
- $username = (string)$_POST["username"];
- $passcode = sha1($_POST["code"]);
- $conn = $database->conn();
- $database->query($conn,$passcode,$username,$result);
- }
- ?>
- <html>
- <head>
- <title>Rock, Paper, Scissors</title>
- </head>
- <body>
- <center>
- <table border="0px" cellspacing="5px" cellpadding="0px">
- <tr><td align="center"><h2>How this works:</h2></td></tr>
- <tr><td><p>1. Type in a username to identify yourself.</p></td></tr>
- <tr><td><p>2. Type in a passcode that matches your opponent's passcode.</p></td></tr>
- <tr><td><p>3. Make a choice between Rock, Paper, and Scissors.</p></td></tr>
- <tr><td><p>4. Click the submit button and you'll see the results of the match.</p></td></tr>
- </table><br>
- <form method="POST">
- <table border="0px" cellspacing="5px" cellpadding="0px">
- <tr><td colspan=1><label>Username: </label></td><td><input type="text" name="username" /></td></tr>
- <tr><td colspan=1><label>Passcode: </label></td><td><input type="text" name="code" /></td></tr>
- <tr /><tr />
- <tr><td align="center"><input type="radio" name="game" value="1">Rock</input></td><td align="center"><input type="radio" name="game" value="2">Paper</input></td><td align="center"><input type="radio" name="game" value="3">Scissors</input></td></tr>
- <tr /><tr />
- <tr><td colspan=2 align="center"><input type="submit" name="submit" value="Submit" /></td></tr>
- </table>
- </form>
- </center>
- </body>
- </html>
Add Comment
Please, Sign In to add comment