NameSilo

URGENT! Carry an ID# (hidden form field) from one site to a different secure site

SpaceshipSpaceship
Watch

Gene

Gene PimentelTop Member
Impact
487
Here's my dilemma. I'm developing an affiliate sales site for a client, on his non-secure domain. We'll call this "domain#1.com". On that site, I have a hidden form field that automatically pulls in an affiliate ID#. So basically, it looks like this in the code of the page:
HTML:
<input type="hidden" name="Referrer_ID" size="35" maxlength="35" value="G77777">
I need to carry that ID# over to a completely different website which is a secure site. We'll call this domain#2.com. On domain#2.com, there will be a standard form where a prospect fills in their payment info along with other personal details.

How can I get that ID# from domain#1.com over to the secure form on domain#2.com? It seems like an easy thing to do, but I just don't know how to accomplish this.

This is urgent -- I need a solution TODAY. I will be highly appreciative for any ideas or solutions!

Thank you!
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Well, I think if the form is set for ACTION="domain#2.com", then you can just recieve the value of that hidden form with $_POST["Referrer_ID"]; If you don't want to do it like that, you can always put the referrer ID in the URL as index.php?rid=G77777. Or finally, you can change the referrer ID to their actual IP, which might be a little bit easier, then once they are to domain#2, change it to a Referrer_ID such as G77777. Hope I helped.
 
0
•••
Code:
<form method='get' action='https://www.domain#2.com/'>
<input type="hidden" name="Referrer_ID" size="35" maxlength="35" value="G77777">
<input type="submit" name="submit" value="Submit">
</form>
When submitted, you'll end up with a url similar to:

https://www.domain#2.com/index.php?Referrer_ID={whatever}&submit=Submit

You could use PHP to grab the Referrer_ID

EDIT: and an example of that:
PHP:
<?php

if(isset($_GET['Referrer_ID']) && $_GET['Referrer_ID'] != '')
{
  $refID = trim(strip_tags($_GET['Referrer_ID']));
  //etc
}
else
{
  //etc
}

?>
 
Last edited by a moderator:
0
•••
Thank you! But how then would I get the ID# to display in the new form (as either a regular or hidden field)? What is the syntax for that?

I created a test page like this, but the $_POST['Referrer_ID'] or $_POST["Referrer_ID"] is not working:
PHP:
<?php

if(isset($_GET['Referrer_ID']) && $_GET['Referrer_ID'] != '')
{
  $refID = trim(strip_tags($_GET['Referrer_ID']));
  //etc
}
else
{
  //etc
}

?>
<html>

<body>
$_POST['Referrer_ID']<br>
$_POST["Referrer_ID"]
</body>

</html>
 
0
•••
In the new form, you would just have a field like this:

PHP:
<input type="text" name="whatever" value="<? echo $_GET['Referrer_ID'] ?>">

This input field can be anything, text, hidden, etc

Can also do something like this:

PHP:
<input type="text" name="whatever" value="<? echo trim(strip_tags($_GET['Referrer_ID'])) ?>">
 
0
•••
Thanks Joe! I'll try them both right now...


gamex said:
In the new form, you would just have a field like this:

PHP:
<input type="text" name="whatever" value="<? echo $_GET['Referrer_ID'] ?>">

This input field can be anything, text, hidden, etc

Can also do something like this:

PHP:
<input type="text" name="whatever" value="<? echo trim(strip_tags($_GET['Referrer_ID'])) ?>">

Edit: It works!! Thanks a million. Is there a benefit of using one over the other? They both seem to produce the same result.
 
Last edited:
0
•••
Gene said:
Thanks Joe! I'll try them both right now...

Edit: It works!! Thanks a million. Is there a benefit of using one over the other? They both seem to produce the same result.
Yes - the second.

www.php.net/trim
www.php.net/strip_tags

strip_tags removes HTML, PHP tags, etc.
It's good to validate input. Because you can really never trust it (even if you're setting it yourself.. )
 
Last edited by a moderator:
0
•••
You guys are life savers. Thanks for coming to my rescue once again!
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy — Zero Commission
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back