When I press the “Submit” button something strange happens: On the screen I get the code of php file shown above.
The code doesn’t update the MySql table. It just appears on the screen.
Any idea what goes wrong?
Thanks
Elaborate on that sentence for me please. Are you seeing the actual code on the page? If so, then your web server isn’t setup properly and it isn’t executing your PHP script, it is just serving it up as a text file.
Thanks,
Could the problem lay on Google chrome?
Here is a more simple code:
<?php
echo "Hello world";
?>
From right click menu on “test.php” which is the above file’s name, I select “open with” and from windows explorer I select:
“Program files, Google, Application, Chrome.exe”.
What I get is the code
This sounds like the root of your problem… PHP won’t execute if you load it into the browser directly from the file system, it has to be served by a webserver with PHP installed.
And the root of my problem it was !
Inside the address bar of my Crome browser I typed: “http://localhost/addhours.php” and the php code initiated by the “Submit” button worked just fine !
Thanks to all of you !