daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Apr 20th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <body>
  3. <h2 align="center">Add New Player</h2>
  4. <p align="center">
  5. <a href="index.php">Home<br></a>
  6.  
  7. <?php
  8.  
  9. if(isset($_POST['insert'])){
  10.  
  11.     $playername = $_POST[player_name_];
  12.     $username_ = $_POST[player_handle_];
  13.     $team = $_POST[player_team_];
  14.     $position = $_POST[player_position_];
  15.     $origincountry = $_POST[player_country_];
  16.  
  17.     echo nl2br("Insert Pressed \n ");
  18.     echo $type;
  19.  
  20. $servername = "localhost";
  21. $username = "james";
  22. $password = "student";
  23. $dbname = "OpticGaming";
  24.  
  25. $link = @mysqli_connect('localhost','james','student', 'OpticGaming');
  26.  
  27.     if (!$link) {
  28.     die('Connect Error: ' . mysqli_connect_error());
  29.     }
  30.  
  31.     $sql = "INSERT INTO
  32.     players(player_id, player_name, player_handle, player_team, player_country, player_position)
  33.     VALUES (0, '$playername', '$username_', '$team', '$origincountry', $position)";
  34.  
  35.     $result = mysqli_query($link, $sql);
  36.  
  37.     if($result)
  38.     {
  39.         echo n12br("Records inserted successfully\n");
  40.     } else {
  41.            echo "Error: " . $sql . "<br>" . mysqli_error($link);
  42.     }
  43. }
  44.  
  45. ?>
  46. <form  method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  47. Player's Full Name:<br> <input type="text" name="player_name_"><br>
  48. Player's Handle:<br> <input type="text" name="player_handle_"><br>
  49. Player's Team:<br> <input type="text" name = "player_team_"><br>
  50. Player's Country:<br> <input type"text" name = "player_country_"><br>
  51. Player's Position:<br> <input type"text" name = "player_position_"><br>
  52. <input type="submit" value="Insert" name="insert"/>
  53. </form>
  54. </body>
  55. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top