dvcrdu
asked on
PHP Code
I have the following html form that has two text boxes "hours" and "wage". I need a PHP script that can compute the hours and any hours over 40 as time-and-a-half. Also the data must be validated to a decimal point value, even the hours. Can anyone help me?
<h2 style = "text-align:center">Enter Paycheck Data</h2>
<form name="paycheck" action="Paycheck.php" method="post">
<p>Hours Worked: <input type="text" name="hours" /></p>
<p>Hourly Wage: $<input type="text" name="wage" /></p>
<p><input type="reset" value="Clear Form" />
<input type="submit" name="Submit"
value="Send Form" /></p>
</form>
ASKER
Will this also validate the data from the text boxes as well?
Thank you!
Thank you!
not very much,
depends on how much checking you want
you could use something like this
if (!is_numeric($hours))
echo "Hours is not a number.";
depends on how much checking you want
you could use something like this
if (!is_numeric($hours))
echo "Hours is not a number.";
ASKER
How can I put that in with your previous code?
Thank you!
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!! That was awesome work!!!
Open in new window