Page 1 of 1

including a file

Posted: Wed Aug 03, 2011 7:30 am
by nite4000
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

Re: including a file

Posted: Wed Aug 03, 2011 7:06 pm
by SabirAhmed
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