Hi All, I am hoping someone might have a simple and quick solution to this.<br /><br />I want to set-up a small page that will register how many credits (? my daughter has earnt doing jobs.<br /><br />She's too young for pocket money but thought this would be a good way to teach her the value of money.<br /><br />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? <br /><br />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).<br /><br />The simpler the better, but then I don't want her adding credits herself.<br /><br />I look forward to hearing any ideas you may have.<br /><br />thanks.<br />Andy<!--content-->
Hello Andy, <br />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.<br /><br />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. <br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->CREATE TABLE Credits (<br /> ID int(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,<br /> TOTAL_CREDITS int(10) NOT NULL,<br /> CREDITS_EARNED int(10) NOT NULL,<br /> CREDITs_USED int(10) NOT NULL,<br /> REASON_FOR_CREDIT VARCHAR(50) NULL,<br /> PRIMARY KEY ( ID )<br /> );<!--c2--></div><!--ec2--><br /><br />Then Initialize the table with some starting data<br />1, = ID<br />50 = amount of total credits <br />0 = credits earned<br />0 = credits used <br />initial start of credits = reason<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->INSERT INTO Credits VALUES (1, 50, 0, 0, "Initial Start of Credits");<!--c2--></div><!--ec2--><br /><br />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. <br /><br />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. <br />I am sure others here have great if not much better solutions for this <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><br /><br />PS<br />a mini tutorial on this is located <a href="http://www.freewebmasterhelp.com/tutorials/phpmysql/1" target="_blank">here</a><!--content-->
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.<br /><br />On the html page, it's as simple as adding the following to the form that lets you update the credit amount:<br /><br /><input type="password" name="secret" /><br /><br />On the processing page, you'd just have to wrap the code in:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->$secret = (isset($_POST['secret'])) ? $_POST['secret'] : '';<br />if ($secret == 'password_you_choose') {<br /><br />/// code to add new row to the database<br /><br />}<!--c2--></div><!--ec2--><br /><br />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.]<!--content-->
Hello Andy, <br />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.<br /><br />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. <br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->CREATE TABLE Credits (<br /> ID int(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,<br /> TOTAL_CREDITS int(10) NOT NULL,<br /> CREDITS_EARNED int(10) NOT NULL,<br /> CREDITs_USED int(10) NOT NULL,<br /> REASON_FOR_CREDIT VARCHAR(50) NULL,<br /> PRIMARY KEY ( ID )<br /> );<!--c2--></div><!--ec2--><br /><br />Then Initialize the table with some starting data<br />1, = ID<br />50 = amount of total credits <br />0 = credits earned<br />0 = credits used <br />initial start of credits = reason<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->INSERT INTO Credits VALUES (1, 50, 0, 0, "Initial Start of Credits");<!--c2--></div><!--ec2--><br /><br />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. <br /><br />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. <br />I am sure others here have great if not much better solutions for this <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><br /><br />PS<br />a mini tutorial on this is located <a href="http://www.freewebmasterhelp.com/tutorials/phpmysql/1" target="_blank">here</a><!--content-->
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.<br /><br />On the html page, it's as simple as adding the following to the form that lets you update the credit amount:<br /><br /><input type="password" name="secret" /><br /><br />On the processing page, you'd just have to wrap the code in:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->$secret = (isset($_POST['secret'])) ? $_POST['secret'] : '';<br />if ($secret == 'password_you_choose') {<br /><br />/// code to add new row to the database<br /><br />}<!--c2--></div><!--ec2--><br /><br />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.]<!--content-->