Created
February 24, 2016 20:36
-
-
Save BloodWolf89/5735b7ddc014b7dadaa8 to your computer and use it in GitHub Desktop.
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
<?php | |
if($_POST['email'] != '') { | |
$db = mysqli_connect('localhost', 'cl54-sstats', '******', 'cl54-sstats') OR die('Database Connection Error.'); | |
$email = mysqli_real_escape_string($_POST['email']); | |
$sql = "INSERT INTO mailing (id, email) VALUES (NULL, '$email')"; | |
if (mysqli_query($sql, $db)) { | |
echo "New record created successfully"; | |
} else { | |
echo "Error: " . $sql . "<br>" . mysqli_error($db); | |
} | |
} | |
?> | |
<form action="index.php" method="POST"> | |
<input type="text" placeholder="Your Email Address" name="email" style="font-size:1.7em;font-weight:none;text-align:center;" /> | |
<input type="submit" value="submit" /> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment