Passing Variables through a Meta Refresh Tag

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ibanez270dx
Forum Commoner
Posts: 74
Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California

Passing Variables through a Meta Refresh Tag

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

single quotes vs. double quotes problem.

have a read: http://php.net/language.types.string
ibanez270dx
Forum Commoner
Posts: 74
Joined: Thu Jul 27, 2006 12:06 pm
Location: Everywhere, California

Post by ibanez270dx »

Thanks for that link! I still couldnt get it to work so I played around with sessions and got it working smoothly.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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?
Post Reply