Page 1 of 1

Passing Variables through a Meta Refresh Tag

Posted: Wed Aug 16, 2006 3:12 pm
by ibanez270dx
Hi,
I'm trying to pass three variables through a meta refresh redirection tag... Here is an excerpt of my script with the code I'm currently using:

Code: Select all

if((!strstr($_POST[hrsdwn1] , ":")) || (!strstr($_POST[hrsdwn2] , ":")))
	{
	 echo '<script>alert("Times were not inputted in the correct format! Use format 00:00 - 24:00");</script>';
	 echo '
<META http-equiv="refresh" content="
0;URL=log_new.php?dwntime_day=$_POST[theday];&dwntime_month=$_POST[themonth]&dwntime_year=$_POST[theyear]">';
		 exit;
	}
It doesn't work to pass the variables... Anyone know how to do it or perhaps an alternate method?

Thanks,
- Jeff

Posted: Wed Aug 16, 2006 3:15 pm
by feyd
single quotes vs. double quotes problem.

have a read: http://php.net/language.types.string

Posted: Wed Aug 16, 2006 3:49 pm
by ibanez270dx
Thanks for that link! I still couldnt get it to work so I played around with sessions and got it working smoothly.

Posted: Wed Aug 16, 2006 4:11 pm
by feyd
Double quote strings attempt to parse variables in them. Single quote strings do not. You are using the latter. Make the documentation on strings more clear now?