cleaning up my code
Posted: Wed Feb 25, 2004 1:46 pm
usually, if i have a bunch of things passed session or form-wise, i like to make them into normal variables, to make them easier to reference, like so:
and so on. but that gets really tedious after awhile, and i remember finding a MUCH better way of doing it.
I believe it did something like run through each thing (post, get, session, etc) and then created a variable for each?.. but i have no idea how to do it, so i was wondering if anyone knows what im talking about
thanks
Code: Select all
$id = $_SESSION['id'];
$page = $_GET['page'];
$date = $_GET['date'];
$amt = $_POST['amt'];
$type = $_POST['type'];I believe it did something like run through each thing (post, get, session, etc) and then created a variable for each?.. but i have no idea how to do it, so i was wondering if anyone knows what im talking about
thanks