Jump to content

Transferring Variables Between Pages...


renno

Recommended Posts

Hey, I'm sorry if this is a novice question...

How is the best way to transfer a variable to another page...

For example getting a variable $ex1 on 'index.php' to $ex1 on 'form.html', with the files being located in the same directory folder... Maybe using headers?

Cheers
Link to comment
Share on other sites

Use $_POST if you feel that you don't want your information to show up on your URL.  Use $_GET if you want all the variables to show up on your URL.  Think of it as do you want someone to book mark the page?  So far, I haven't found solutions using PHP only to POST without input type submit, but you can always use javascript to submit without input type submit if it's a form. 

You can always create your own <a href="http://us3.php.net/manual/en/ref.session.php">SESSION</a> variables and store it in memory so no matter which page you go, there exist variables you want to use until session expires.  This way, you don't have to show anything in URL and not rely on people to click submit button.

Happy Friday  ;)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.