Web Hosting Talk







View Full Version : referral script? help?


michael-lane
07-15-2005, 03:09 PM
this is my script for a referreral script:
<?php
/*get referrer id*/
$r_id = $_GET[r_id];
if($r_id==FALSE) {
echo "<input type=\"text\" name="\referrer\" value=\"$r_id\">";
}
else {
echo "<input type=\"text\" name="\referrer\" value=\"referrer id here\">
}
problem is i dont want users to just refer i want them to refer people who browse and sign-up which is why i want to know some stuff. Right once a form has submitted a form data to a url, is that data still available after they click a link from the from that page? or is that IMPOSSIBLE and would i have to do something like I.P. tracking that saves the referrer id into a database for that I.P. then deletes it if it that I.P. is unactive on the site after 5-10 mins?

sdnet
07-15-2005, 04:00 PM
Your message is uncomprehensible, at least to me. Can you re-state what you're trying to do, here? If you only want people to be able to refer people who signed up (I THINK that's what you're trying to say), just query the database for that person. If the record exists, then great. If not, then don't accept that as a proper referral.

michael-lane
07-15-2005, 04:40 PM
dude to explain better,
i want people to browse my site after following a referral link and the $_POST variable to remain on each page

sdnet
07-15-2005, 08:19 PM
Okay, there are a couple ways to do this. First, you can pass the variable through the query string ($_GET), or you can assign the POST variable to a session, then keep track of the session throughout the pages. If you choose the latter, PHP.net has good explanations of how to use PHP's built-in session management functions.

talifellow
07-15-2005, 11:16 PM
Using sessions as the poster above me said is the best idea with PHP