Jump to content

pass data from url to url


Don Diego

Recommended Posts

 

 

I want to pass the varying value of "subid" in this url:

 

http://abcwebsite.php?subid=xxxxxx

 

into "source" in this url:

 

http://xyzwebsite.htm?source=xxxxxx

 

The latter page opens using:

 

<?php
header ("location:http://xyzwebsite.htm?login=apin&source=xxxxxx");
?>

 

Howwever, the value of xxxxxx changes unpredictably (not generated by me) so I need to specify it in general terms.

 

Any suggestions as to where to look or what function to use?

Link to comment
Share on other sites

ok, well if your getting the value from a form, use

 

$_REQUEST array.

 

 

then you need to send from the _GET array in the first value variable, then pass it to the second page

eg

on page with header

 

 

$URL = $_GET['subid']

header("location:http://xyzwebsite.htm?$URL");

 

goo dluc, if you need more help just post

 

 

Link to comment
Share on other sites

Thank you kenrbnsn and PC nerd for your suggestions, but I cannot get that to work.

 

The page opens, but there is no value for source=.

 

By contrast, when I include:

 

<input type="hidden" name="subid" value="<?php echo htmlentities($_GET['subid']); ?>" />

 

in the form, the subid value is included in the email.

 

Since it works in emailing from a form, I am baffled as to why ($_GET['subid'] does not also work to transfer the value from url to url.

 

The value for subid is generated upon clicking the link that goes to the form, not by anything in the form itself.

 

Link to comment
Share on other sites

There is no more code.

 

This is the only code in the php file that exists for this issue:

 

<?php
header ("location:http://xyzwebsite.htm?login=apin&source=" . $_GET['subid']);
?>

 

What else could be needed? Should a different function be used?

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.