Skip to content

Instantly share code, notes, and snippets.

@dangrossman
Created September 27, 2014 17:58
Show Gist options
  • Save dangrossman/f59bd986c7cd0eb9633c to your computer and use it in GitHub Desktop.
Save dangrossman/f59bd986c7cd0eb9633c to your computer and use it in GitHub Desktop.
<?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