including a file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nite4000
Forum Contributor
Posts: 209
Joined: Sun Apr 12, 2009 11:31 am

including a file

Post 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
SabirAhmed
Forum Newbie
Posts: 23
Joined: Tue Aug 02, 2011 11:56 am

Re: including a file

Post 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
Post Reply