Jump to content

Referral Programme


Gubbins

Recommended Posts

Can anyone help please?

 

I have a file given to me that provides a Referral link like this:-

http://www.gbmafia.com/register.php?ref=Gubbins

 

In the database i have the following field:-

Field=referral  Type=INT  Length/values=11

 

In the register.php file i put the following:-

$reff = $_POST['reff'];
mysql_query("UPDATE players SET referral=referral+1 WHERE playername='$reff'");

 

But this doesn't enter anything into the database.

 

Can anyone see where i have gone wrong please?

 

Thanks

 

Gubbins

 

Link to comment
https://forums.phpfreaks.com/topic/187770-referral-programme/
Share on other sites

Variables in the query_string (at the end of a URL) are in the $_GET array, not the $_POST array. Also the link uses 'ref' whereas the key you attempted to use in the $_POST array is 'reff'.

 

arr yes i follow most of what you said but if you don't mind could you show me what you mean so i know how to write it in the register file.

 

Thank you for your help.

Link to comment
https://forums.phpfreaks.com/topic/187770-referral-programme/#findComment-991370
Share on other sites

Depends on your server settings. If magic_quotes_gpc is disabled then all you should need to change is to pass the $_GET variable through the functions. IE...

 

$ref = mysql_real_escape_string($_GET['ref']);

 

That worked a treat..

Thank you very much!

 

 

Link to comment
https://forums.phpfreaks.com/topic/187770-referral-programme/#findComment-991390
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.