Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "createUser.php";
- ini_set('display_errors', 1);
- ini_set('display_startup_errors', 1);
- error_reporting(E_ALL);
- $servername = "localhost";
- $username = "webUser";
- $password = "davedog";//i think..
- $dbName = "webData";
- $conn = new mysqli($servername, $username, $password, $dbName);
- if($conn->connect_error){//Error on connection?
- die("C0nnection failed: " . $conn->connect_error);//then show the error
- }
- echo "Connected successfully!";
- echo <<<HTMLOPEN
- <html>
- <body>
- HTMLOPEN;
- echo "<h2>Major Lab</h2><br /><form id='frmMain'><label for='txtUsrName'>Username:</label><input type='text' id='txtUsrName'><br /><label for='txtName'>Name:</label><input type='text' id='txtName'><br /><input type='submit' action='createUser.php'>";
- echo <<<HTMLCLOSE
- </body>
- </html>
- HTMLCLOSE;
- $sql = "SELECT id, name, country FROM state WHERE country='Canada';"; //Query String
- $result = $conn->query($sql);//Execute and store
- echo "<select id='slctProvinces'>"; //start the select box
- while($row = $result->fetch_assoc()){
- echo "<option value=" . $row["id"] . ">" . $row["name"] . "</option>"; //For each province, add an option
- }
- echo "</select></form>";//End the select box and the form
- $conn->close(); //Close the connection
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement