I wanted to make a feedback form for my website and know nothing of PHP so I decided to try an automatically generated one at thesitewizard dot com. But when I test out the page locally it shows me the .php file which has sensitive information in it (email, reCAPTCHA private key) instead of thankyou.html. This is how the HTML links to the php file: <form action="feedback.php" method="post">[...]</form> The php file and feedback.html (which contains the feedback form) are both located in the base directory. So will pepole be able to see the contents of the php file if I upload it to a host? Sorry guys, I'm completely new to PHP.
The answer is no, people will not be able to see any PHP scripting on your website. They can only see the HTML/CSS, JavaScript, jQuery and AJAX. Thanks, Michael
PHP is a server side scripting language. They will not be able to see the code unless the gain root access into your server.
If you PHP is set to output (echo) any HTML then the resulting HTML only will be displayed... however, sounds an obvious one, but make sure your host supports or has PHP enabled... some windows servers\setups will output the php file as if you were viewing it in notepad rather than processing it.
If it isn't currently uploaded to a host and your checking it on your computer it will not support php without installation of a server on your computer such as WAMP. If after it is uploaded to your host, then it should work as normal, unless your host either doesn't support it, or has an error in the code something like the others stated before me.
if you close your ?> and continue the php code it will be displayed as html in which case if would be shown. Other wise you must place all code you wish to display to the user within an echo "display code here " statement. This code is then rendered as standard html and JavaScript by the browser.
of course not, because php is a programming on the server side, so that clients can not see the php script, which they could see only on the client side programming like HTML and CSS, and JavaScript as well.