Jump to content

script to script value/variable transfer.


lewashby

Recommended Posts

I've scooped up the variables via $_POST from and html from and now they're available in my current php script/file. But what if I wanted to send those values to another php script that will not have the luxury using $_POST to gather the html form variables since the form points to the script that executed/called the current script, not the current script it's self. Any ideas on how I can accomplish this? Thanks.

Link to comment
https://forums.phpfreaks.com/topic/282660-script-to-script-valuevariable-transfer/
Share on other sites

I have a script that gets it's values via $_POST and then jumps to another script via the header() function, so I need to somehow pass the variables from the first script to the one that the header function jumps to. I think I need to take a look into sessions.

Sessions or if they are simple vars that don't need to be hidden you can put them as get params in the redirect URL:

header("Location: www.example.com/page.php?var=$var1&var2=$var2');

Then get them on the next page:

echo $_GET['var1'];

But I would probably use sessions, and it will be handy to learn them.

Archived

This topic is now archived and is closed to further replies.

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