Jump to content

Simple php help


vato116

Recommended Posts

I keep getting this error message: Parse error: syntax error, unexpected 'Your' (T_STRING) in C:\xampp\htdocs\Salary.php on line 8.

 

 

<?php

$h=$_GET['hours'];

$r=$_GET['rate'];

$p=$_GET['pay'];

 

if ($h <= 40){

$submit = ("$p = $h * $r)

echo "Your Weekly Salary Is: $p;

}

if ($h > 40){

$submit = ("$p = ($h *$r) + (($h - 40) * $r * 1.5)")

echo "Your Weekly Salary Is: $p;

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/274472-simple-php-help/
Share on other sites

Sorry. I have no idea what that means.

 

This is what i did.

 

 

<?php

$h=$_GET['hours'];

$r=$_GET['rate'];

$p=$_GET['pay'];

 

if ($h <= 40){

("$p = $h * $r);

echo "Your Weekly Salary Is: ".$p;

}

if ($h > 40){

("$p = ($h *$r) + (($h - 40) * $r * 1.5)");

echo "Your Weekly Salary Is: ".$p;

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/274472-simple-php-help/#findComment-1412384
Share on other sites

Okay, so I managed to change some thing. This is what i got, but now its telling me this: Notice: Undefined index: pay in C:\xampp\htdocs\Salary.php on line 4

Your Weekly Salary Is:

 

 

<?php

$h=$_GET["hours"];

$r=$_GET["rate"];

$p=$_GET["pay"];

 

if ($h <= 40){

$submit = ("$p = $h * $r");

echo "Your Weekly Salary Is: ".$p;

}

if ($h > 40){

$submit = ("$p = ($h *$r) + (($h - 40) * $r * 1.5)");

echo "Your Weekly Salary Is: ".$p;

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/274472-simple-php-help/#findComment-1412386
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.