I hope someone can help me here
i have a script that does referrals and when a referral commision is given its credits when the user that is owed the amount is logged in however if i am to refresh the page it keeps giving the money so my problem is how can i do that where it wont keep adding the commision to that user or anyone elses
Don
including a file
Moderator: General Moderators
-
SabirAhmed
- Forum Newbie
- Posts: 23
- Joined: Tue Aug 02, 2011 11:56 am
Re: including a file
It's probably because you have told the php to input the amounts as soon as the page reloads (you probably have the relevant php coding right at the top of the page, with no if statement attached to it.
You shoudl probably try putting the commission amounts to be updated into a form, and then having a statement that says
if ($_POST['commision']) {
... coding for updating commission gioes here ...
}
Here commission is the name of the submit button you use for your form.
This way the commission will only be added when that submit button is pressed and not when the page is refreshed.
Hope this helps
You shoudl probably try putting the commission amounts to be updated into a form, and then having a statement that says
if ($_POST['commision']) {
... coding for updating commission gioes here ...
}
Here commission is the name of the submit button you use for your form.
This way the commission will only be added when that submit button is pressed and not when the page is refreshed.
Hope this helps