Problem getting my program to print in PHP

Hi all. I'm having an issue that I CAN NOT figure out for the life of me.
The program is to get user input about there paycheck , then calculate the answer.

What my problem is I can not get the php part to print anything inside the <?php?> tags. Not even a simple echo statement of my name will print out of I wipe the code and go from there. So maybe someone can see whats going on here and help me out.

the way your doing it now is converting your get values to the value of pay which is nothing

The GET values are appearing in the URL

file:///C:/wamp/www/Paycheck.php?hoursWorked=45&hourlyWage=12.75

I went and changed it to:

$pay = ("$hours * $wage");

And its still just coming up a blank page besides the <h1>tag</h1>

I've went through and wiped out the code multiple times and just tried to get it to print out my name and it wont even do that. Wiped out both pages and redid them both line by line and it still just comes up with the same problem. Then I've tried to see if it was a problem else where but all my other pages work just fine.

There is no form submit to invoke the php handler once the data is filled out.
PHP runs before the form is displayed, or again if "self" is invoked in the form action.
If you want "real time" results , you might want to look into javascript.

There is no form submit to invoke the php handler once the data is filled out.
PHP runs before the form is displayed, or again if "self" is invoked in the form action.
If you want "real time" results , you might want to look into javascript.

Not exactly sure what you mean here. Just trying to have a user enter their hours worked and wage, then go to a results page somewhat like a quiz and print out their gross pay.

I'm obviously missing something here. Once I enter the pay and hours, it flips to the results page. The GET values are in the URL however all its showing is the Paycheck Results heading and then a blank page no errors, nothing actually.

Tried to validate my code through the WDG validator comes back clean with no errors.

Do you mean I'm missing some sort of calling method when they hit the calculate button on the form page?

Dont know why, but i retyped (not copied and pasted) all of the code and it worked!!

Ive found sometimes in the past if somethings copied into an editor sometimes characters that look like a syntax character stop the code from working. For example there are a number of different kinds of " and at least 7 different single quotations.

Oops I didn't see the form part.
That output will just display at the top of the page in an unformatted way.
Ok for an experiment.
why do you $usehoursWorked then pass it ti $hours?
How about setting the $hours var equal to the $_GET and be done with it?
the same applies to to the $hourlyWage.

$pay = ($hours * $wage) + (($hours - 40) * ($wage * 1.5)));

too many parenthesis?

$pay = ($hours * $wage) + (($hours - 40) * ($wage * 1.5));

A white page indicates that the PHP code crashed.
Aren't you running with ERRORS_ON ?????? It would tell you.

Oops I didn't see the form part.
That output will just display at the top of the page in an unformatted way.
Ok for an experiment.
why do you $usehoursWorked then pass it ti $hours?
How about setting the $hours var equal to the $_GET and be done with it?
the same applies to to the $hourlyWage.

$pay = ($hours * $wage) + (($hours - 40) * ($wage * 1.5)));

too many parenthesis?

$pay = ($hours * $wage) + (($hours - 40) * ($wage * 1.5));

A white page indicates that the PHP code crashed.
Aren't you running with ERRORS_ON ?????? It would tell you.

I see what your saying for setting $hours = $_GET["hoursWorked"];

As for running with ERRORS_ON, I "think" I am. What I mean by that is this is my first use with WAMP so not real sure where to turn it on and off to be completely honest, and if it even has anything to do with WAMP.

However, when I switch my code around even with setting it like above I still get the blank page, and have no idea how to even tell which line and where the program is going bonkers on me.

As for running with ERRORS_ON, I "think" I am. What I mean by that is this is my first use with WAMP so not real sure where to turn it on and off to be completely honest, and if it even has anything to do with WAMP.

However, when I switch my code around even with setting it like above I still get the blank page, and have no idea how to even tell which line and where the program is going bonkers on me.

Ok found the settings in WAMP for the errors. I am running with them on however it doesn't kick up any errors. Error logs are blank, I'm not finding a thing. Validation doesn't kick up any errors, nothing.

hoursWorked and hourlyWage are only coming up as undefined indexes due to me not opening the forum page and entering a value.

As for the grosspay() I can see why that is throwing an error I don't really have it set to anything. Which I will fix.

OK now you are on your way to getting this figured out. ( nothing like having the right tools for the job -eh?)
Always be cognisant of the state of the variables. initially there is no $_get until you fill in the form and submit it.
use a trap for it.

OK now you are on your way to getting this figured out. ( nothing like having the right tools for the job -eh?)
Always be cognisant of the state of the variables. initially there is no $_get until you fill in the form and submit it.
use a trap for it.

Thanks. Appreciate all the help very much. One of my problems after stepping away and coming back was something so simple as my server not being online. So it wasn't working correctly from the local disk. After that I got it to work, and then started to play around a bit with the code you provided above to see the differences and clean my code up.