dadamssg Posted March 6, 2009 Share Posted March 6, 2009 so i can't for the life of me figure out why this isn't working. heres the scenario...I have a form that the user can dial in a date click a button, the script will calculate how many days until that date and put the number in the url to a page that takes that number and displays events based on that number. the url below is the example mysite.com/test/page1.php?days=12 this page spits out events that start, end or are happening on that day. (this part works perfectly) on this page there is a button that im trying to program to grab that number '$days' and put it in another url and then send the user to that url. the problem: it won't grab that number.it will send the user to the url with no number attached. ex. below. mysite.com/test/page2.php?days= i don't know why the heck the first date calculator script is putting the number in the url and then grabbing the number to use in a query while my other script grabs nothing. the stupid little simple script: <?php /*creates a new url with variable to send to page2.php*/ session_start(); $days = $_GET["days"]; header("Location: http://www.mysite.com/test/page2.php?days=$days"); ?> Link to comment https://forums.phpfreaks.com/topic/148184-solved-_get-problem/ Share on other sites More sharing options...
Stephen68 Posted March 6, 2009 Share Posted March 6, 2009 Did you try echoing out the value of $days before doing the redirect to see if there is a value? $days = $_GET['days']; echo $days; Link to comment https://forums.phpfreaks.com/topic/148184-solved-_get-problem/#findComment-777850 Share on other sites More sharing options...
dadamssg Posted March 6, 2009 Author Share Posted March 6, 2009 yeah i tried that, and i know its grabbing nothing, because i use that number in a query on the page and it comes up with a mysql error where i can see that theres nothing in the query. Link to comment https://forums.phpfreaks.com/topic/148184-solved-_get-problem/#findComment-777852 Share on other sites More sharing options...
dadamssg Posted March 6, 2009 Author Share Posted March 6, 2009 i experimented with the session variables and got it workin Link to comment https://forums.phpfreaks.com/topic/148184-solved-_get-problem/#findComment-777883 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.