Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo '<form style="text-align: center; width: 100%"; id="rsaid" action="" method="post"><h2 style="color: orange; font-size: 2.4rem;">RSA ID Number</h2><input style="text-align:center; margin-right: 10px; width: 100%; margin-bottom: 10px; padding: 10px;" type="text" name="ID" placeholder="Enter your 13 Digit RSA ID Number" maxlength="13" minlength="13"></br><input style="background-color: #FB8C00; color: white; border-radius: 30px; border-color: white; margin-top: 20px;" type="submit" name="submit" value="Submit"></form>';
- //Database Information
- $dbServername = "xxx";
- $dbUsername = "xxx";
- $dbPassword = "xxx";
- $dbName = "xxx";
- //Link to database
- $link = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
- // Check connection
- if($link === false){
- die("ERROR: Could not connect. " . mysqli_connect_error());
- }
- // Escape user inputs for security
- $identity = mysqli_real_escape_string($link, $_REQUEST['ID']);
- // Attempt insert query execution
- $sql = "INSERT INTO idNumbers (ID) VALUES ('$identity')";
- if(mysqli_query($link, $sql)){
- echo "Records added successfully.";
- } else{
- echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
- }
- // Close connection
- mysqli_close($link);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment