Jump to content

[SOLVED] $_GET problem


dadamssg

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.