Hello all,
I´m not sure if i´m on the right place to post this, i´m sorry if not.
I need some help with a php script i´m not good with php but can make few small things.
What i´m looking for is a calculator " form " that has a fixed value when someone insert a value it should multiply that value over a fixed value.
My main problem is that the fixed value can chnage some times, so i need a option to change that value from a "admin" secction where i can protect that page with a password.
An example how it should work is: 25 * "fixed value 235" = 5.875
Someone entred the value 25 and it should show the result over the fixed (hiden) value.
Sorry for my bad English, thank you all.
PHP multiplication and result
Moderator: General Moderators
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: PHP multiplication and result
keywords=login+script
You can search through the forum under the "Security" thread, this topic (login / securing pages) has been covered quite a few times
You can search through the forum under the "Security" thread, this topic (login / securing pages) has been covered quite a few times
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: PHP multiplication and result
This is not a login / security script, i know how to protect a page, but i dont know how to make the calculator and show the results.social_experiment wrote:keywords=login+script
You can search through the forum under the "Security" thread, this topic (login / securing pages) has been covered quite a few times
Thank you for the reply.
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: PHP multiplication and result
Ah ok, sorry my english is a bit rusty.vippt wrote:My main problem is that the fixed value can chnage some times, so i need a option to change that value from a "admin" secction where i can protect that page with a password.
The calculator is relatively easy : 1 form which accepts user input, 1 script to process user input.vippt wrote:but i dont know how to make the calculator and show the results.
Code: Select all
<?php
// simplified version of what you need
$userInput = $_POST['userInput'];
$fixedValue = 235;
$answer = $userInput * $fixedValue;
echo $answer;
?>“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering