Jump to content
xisto Community
Sign in to follow this  

Credit System - Transfer Credits Between Members?

Recommended Posts

Ok, so I currently got a website were the users are allowed to view each others profiles (Feelays system).But im making a new feature where the members gets credits for various things they do.But I want to make a script that the members can use to transfer credits between each others.Only problem is, I have no clue how to do it?Could be something like this:Welcome -USERNAME-.Transfer credits to [------] /form box/[send] /button/

Share this post

Link to post
Share on other sites

You forgot one important thing in that little list: the number of credits you want to transfer. Unless of course you plan on sending them one at a time, or something, but anyway...


I roughly know Feelay's tutorial on profiles, although I lack the effort to go and have a look. From what I remember, though, he's done a tutorial on sending private messages (PMs / mail) to other users? If so, the idea of sending credits is far more simple. Basically all you're doing (ignoring the part where people receive credits, which would work in whatever way you see fit) you just need to do the following (in steps, not code, because I'm lazy and it gets you thinking rather than copying/pasting):

present the form

once user has clicked "send" check the input fields (i.e. sanitise and validate any that need doing, so no sending of negative credits, all the inputs completed etc.)

access the database

make sure the user has enough credits to send

make sure the receiving user exists

deduct that many credits from the user, add them to the credits of the receiver

display a message so the user knows

There are a lot more substeps of course, but it should get you thinking.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.