Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

Opening a page with a passed variable

I have a page with a variable (form.id). If the user clicks a certain button I need to open another page and still have access to that variable value so that I can later re-open the first page in the same state (the variable is used in an Access query). What is the method of passing a value between pages?
0
Helicopter
Asked:
Helicopter
  • 4
  • 2
1 Solution
 
Christian_WenzCommented:
using JavaScript, you can pass variables: the url changes to www.server.com/page.html to, let's say www.server.com/page.html?yourvariable

so in your case, you have to load the page xxx.html?form.id (in JavaScript, you would use location.href="xxx.html?"+formid or something like that.

On the next page, you can use location.search to get the question mark and everything that follows, in this case ?formid

if you have additional questions or need more detailled code, please leave me a comment.
0
 
Christian_WenzCommented:
of course, you could alternatively use a cookie instead
0
 
ozoCommented:
Or, as Experts-Exchange does it, with <input type=hidden>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Christian_WenzCommented:
aargh, how obvious. I completely overlooked that! :-)
0
 
Christian_WenzCommented:
aargh, how obvious. I completely overlooked that! :-)
0
 
HelicopterAuthor Commented:
Thanks for the input. I had a feeling I'd need hidden fields. If I can just clarify a bit.

booking.htm is created by a cgi routine which runs SQL. This page shows a list of people. It also has a variable ##course.id## . If the user doesn't appear on this list, they go to register.htm and add their details to the server side database. What I would like to happen is, after the registration, reload booking.htm, updated so their name appears in the list. For this I need ##course.id## to be available from register.htm so that I can run the same cgi routine.

I'm not sure how to populate a hidden field with a passed parameter....
0
 
HelicopterAuthor Commented:
I'll close this one I think, thanks for the pointers.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now