ffxpwns Posted May 22, 2012 Share Posted May 22, 2012 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. Quote Link to comment Share on other sites More sharing options...
ManiacDan Posted May 22, 2012 Share Posted May 22, 2012 Ok...do that. On the PHP page that prints the registration form, if $_GET['id'] is set, pre-fill the referral information. Quote Link to comment Share on other sites More sharing options...
ffxpwns Posted May 22, 2012 Author Share Posted May 22, 2012 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? Quote Link to comment Share on other sites More sharing options...
ffxpwns Posted May 22, 2012 Author Share Posted May 22, 2012 Dammit, I keep putting referral when I mean register. My bad. Quote Link to comment Share on other sites More sharing options...
ManiacDan Posted May 23, 2012 Share Posted May 23, 2012 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. Quote Link to comment Share on other sites More sharing options...
ffxpwns Posted May 23, 2012 Author Share Posted May 23, 2012 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'], Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.