Jump to content

Help Needed With Tricky Financial Problem


andypeat

Recommended Posts

Hi All, I am hoping someone might have a simple and quick solution to this.

 

I want to set-up a small page that will register how many credits (£) my daughter has earnt doing jobs.

 

She's too young for pocket money but thought this would be a good way to teach her the value of money.

 

Is it possible that there is a page that will show the total amount she has earnt and then give me a way to add to the total when she has done a job?

 

It will be on-line and we will have to access it daily for about three months as she wants to save for something (even though she will probably get it before the month is up).

 

The simpler the better, but then I don't want her adding credits herself.

 

I look forward to hearing any ideas you may have.

 

thanks.

Andy

Link to comment
Share on other sites

Hello Andy,

One method of doing this would be to create a pretty simple database that holds the data and then have a php script to add and subtract from that database table and report it to the html page.

 

I do not have the time right now to assist with this but I am sure others here would be willing to help with pointing you in the right direction.

 

>CREATE TABLE Credits (
ID int(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,
TOTAL_CREDITS int(10) NOT NULL,
CREDITS_EARNED int(10) NOT NULL,
CREDITs_USED int(10) NOT NULL,
REASON_FOR_CREDIT VARCHAR(50) NULL,
PRIMARY KEY ( ID )
);

 

Then Initialize the table with some starting data

1, = ID

50 = amount of total credits

0 = credits earned

0 = credits used

initial start of credits = reason

 

>INSERT INTO Credits VALUES (1, 50, 0, 0, "Initial Start of Credits");

 

What you would need to do next would be to create a page that would allow you to display what is currently in your CREDITS Database and display them any way you like.

 

Just a start for you to think about, what I would recommend is that you take a look at some PHP MySQL examples to get an understanding of how to display the database results on a page.

I am sure others here have great if not much better solutions for this :D

 

PS

a mini tutorial on this is located here

Link to comment
Share on other sites

One way to simplify the control of who adds credits would be to hard-code a password into your processing page. Then on the HTML page where you view credits and add them in, include a form space to enter the password as well; this would keep your daughter from adding credits at whim but would not add an extra login process for you--you just have to remember the password.

 

On the html page, it's as simple as adding the following to the form that lets you update the credit amount:

 

<input type="password" name="secret" />

 

On the processing page, you'd just have to wrap the code in:

 

>$secret = (isset($_POST['secret'])) ? $_POST['secret'] : '';
if ($secret == 'password_you_choose') {

/// code to add new row to the database

}

 

That doesn't help with the actual database stuff, I know (I wish I had time to help there, too), but it is a simple way to control who adds the credits in. [if you use GET instead of POST on your form, change the _POST above to _GET.]

Edited by owatagal
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...