Forked from BloodWolf89/gist:5735b7ddc014b7dadaa8
Last active
February 24, 2016 20:45
-
-
Save travisdmathis/bc797a6abedff388a313 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 (email) VALUES ('$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="email" 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