Jump to content

Url that will fill out peice of a form?


ffxpwns

Recommended Posts

I want to have a URL that each person would have on their profile, to refer new users.  What I'm thinking is the URL would be www.website.com/register.php?id=(users ID) Lets pretend that it's www.website.com/register.php?id=23 and the user with the ID 23's name is just 'testuser'.  Then, when they open that page, it would be normal, but the 'referrer' field would have 'testuser' in it.  Any ideas?  I don't even know what to search because I don't know what to name that.

Link to comment
Share on other sites

Ok...do that.  On the PHP page that prints the registration form, if $_GET['id'] is set, pre-fill the referral information.

 

Seriously?  So I don't need to do anything special with the URL or the page?  just where the referral field is, I put somehting like $_GET['id'] and then I'd associate the ID with the username, and it'd fill out the feild?

Link to comment
Share on other sites

No, it's not magic.  I'm assuming you have a PHP page which draws the registration form in some way.

 

On that page, if $_GET['id'] is set, perform the necessary database queries to fetch the referral information.

 

When you print the referral bits of the form, check to see if you have data to put into those fields.

 

If you do, pre-fill the form fields with the data you fetched from the database.

 

 

Link to comment
Share on other sites

No, it's not magic.  I'm assuming you have a PHP page which draws the registration form in some way.

 

On that page, if $_GET['id'] is set, perform the necessary database queries to fetch the referral information.

 

When you print the referral bits of the form, check to see if you have data to put into those fields.

 

If you do, pre-fill the form fields with the data you fetched from the database.

 

I meant that i didn't have to do anything radical with the page.  I just ended up putting

'V_REFER' => (isset($_POST["TPL_refer"])) ? $_POST["TPL_refer"] : $_GET ['referrer'],

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.