Passing variables with refresh or redirect

I want to use either HTML or PHP to redirect my user to another page.  However, there are variables being passed from the previous page that need to be passed along as well.

Is there any way to do this OTHER than sticking them in the URL (such as... www.blah.com/page.html?variable1=value1,variable2=value2,etc)
dhuggyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Jan LouwerensConnect With a Mentor Software EngineerCommented:
you can create a form in the page. have the target be the desired page. stick all the values into the form as hidden fields. in the onLoad function of your page, call submit() on your form.
0
 
mblaseCommented:
Although this route is more complicated than simply sticking them in the URL query string, as you're trying to avoid, dhuggy. Are you trying to hide this data from your users so that they can't read it, or is there some other reason you're avoiding this solution?
0
 
andropovCommented:
Why don't you use cookies? You can set and retrieve themwith Javascript at clientside.
0
 
dhuggyAuthor Commented:
>Are you trying to hide this data from
>your users so that they can't read it,
>or is there some other reason you're
>avoiding this solution?

Not so much so that they can't READ it, but so they can't ALTER it.  In my experience, there's always a wanna-be hacker who tweaks a variable, and it screws up the database or something... it's best to keep it transparent as much as possible.

Also, for purely asthetic reasons, I find those lengthy URLs somewhat gross.  Of course, as a wanna-be hacker myself, I appreciate that they exist, because they've allowed to some interesting portions of a few sites that I couldn't have got to otherwise.

I've gotten sidetracked, but as soon as I can code jlouwere's solution and get it to work, I'll accept his comment as answer.  This seems easier to me than opening the cookie jar... but thanks anyway for the idea, andropov.
0
All Courses

From novice to tech pro — start learning today.