Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1);
- ini_set('display_startup_errors', 1);
- error_reporting(E_ALL);
- if( $_POST["usrName"] || $_POST["usrPass"])
- {
- echo "Welcome ". $_POST['usrName']. "<br />";
- echo "Your password is ". $_POST['usrPass']. "<br />";
- echo "You are on team ". $_POST['radBox']. "<br />";
- echo "Welcome" . $POST["usrName"]."<br />";
- echo "You are team " . $_POST["radBox"] . ".";
- $servername = "localhost";
- $username = "webUser";
- $password = "davedog";
- $dbName = "webData";
- $conn = new mysqli($servername, $username, $password, $dbName);
- if($conn->connect_error)
- {
- die("Connection Failed :/ " . $conn->connect_error);
- }
- echo "Connected!";
- $sql = "SELECT * FROM webData.username;";
- $result = $conn->query($sql); //Execute
- $theUrl = "Login.php?usrName=".$_POST["usrName"]."&usrPass=".$_POST["usrPass"]."&radBox=".$_POST["radBox"];
- $count = mysqli_num_rows($result);
- echo "result: ".$count;
- if($count >= 1)
- {
- header('Location: '.'Welcome.php');
- exit();
- }
- exit();
- }
- //action='<?php $_SERVER['PHP_SELF']
- ?>
- <html>
- <h2>Login dot pea aytch pea</h2>
- <br /><form id='myForm' action='Welcome.php' method = 'POST'>
- <label for='usrName'>Username:</label><input type='text' name='usrName' id='usrName'><br />
- <label for='usrPass'>Password:</label><input type='password' name='usrPass' id='usrPass'><br />
- <br /><label for='radBox'>Who shot first?</label>
- <br /><input type='radio' name='radBox' value='Han' checked>Han<br />
- <input type='radio' name='radBox' value='Greedo'>Greedo<br />
- <input type='submit'/>
- </form>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement