Created
April 14, 2015 00:20
-
-
Save ramytamer/d44c50cb276aba2cf9d6 to your computer and use it in GitHub Desktop.
ateg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <form action="" method="post"> | |
| <input type="text" name="response" placeholder="Your response"> | |
| <input type="submit" value="OK"> | |
| </form> | |
| <?php | |
| echo "<pre>", print_r($_POST), "</pre>"; | |
| if (isset($_POST['response']) && !empty($_POST['response'])) { | |
| // because we used name = response in input field | |
| $response = $_POST['response']; | |
| $db = new mysqli("localhost", "root", "r.134679+", "atef"); | |
| $sql = $db->prepare(" INSERT INTO `responses` (`response`) VALUES (?) "); | |
| $sql->bind_param('s', $response); | |
| $sql->execute(); | |
| } | |
| ?> | |
| <script> | |
| // document.getElementsByTagName('form')[0].submit(); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment