I've been trying to add a referrer mod to my PHPBB, but have had little luck so I am attempting to make my own.
I want to make a PHP script that will add 50 to a table field in MySQL every time someone enters a username into a field.
Here is the HTML I am going to add
I want that to add 50 to my MySQL table field "user_refer."
<input type="text" value="Referrer" />
If the user does not exist I want it to ignore that part of the PHP and move on.
So, lets say Johnny joins the forum and was referred by Josh. Josh has 500 referral points. If Johnny submits the form with Josh's name in the Refer field then Josh should receive 50 more points thus making 550. If he spells it Josh "Jsoh," I want the script to continue so Johnny still becomes a registered member.
I am still learning about PHP but I think I got an idea with what I need to do...
Now, that I have it I need to add 50 to it and then reinsert it.
$refer = $_POST['refer']
SELECT user_refer FROM phpbb_users WHERE username = "$refer";
But, I do not know how to make the above line a variable or how to copy over the existing MySQL entry of 500 and make it 550.