Created
September 27, 2014 17:58
-
-
Save dangrossman/f59bd986c7cd0eb9633c to your computer and use it in GitHub Desktop.
This file contains 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 | |
mysql_connect('localhost', 'username', 'password'); | |
mysql_select_db('dbname'); | |
$sql = "INSERT INTO downloads (email) VALUES ('" . mysql_real_escape_string($_GET['email']) . "')"; | |
mysql_query($sql); | |
header("Content-type: application/pdf"); | |
readfile("/path/to/thefile.pdf"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment