Skip to content

Instantly share code, notes, and snippets.

@meeDamian
Created December 20, 2011 12:56
Show Gist options
  • Save meeDamian/1501497 to your computer and use it in GitHub Desktop.
Save meeDamian/1501497 to your computer and use it in GitHub Desktop.
[ PHP | lib ] retreive data passed by POST request
<?
// put this at the beginning of file, or where you'd like to start receiving data
$ok=true;
foreach(array('put','here','names','of','passed','POST','data','indexes') as $v)$ok&=(bool)($$v=(isset($_POST[$v]))?$_POST[$v]:false);
/*
* output:
* - $ok => states if errors occured
* - $name => every index gets changed into variable
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment