Page 1 of 1

Is this .PHP or what?

Posted: Tue May 06, 2003 1:28 pm
by zeno
Please take a look at this page:

http://www.teameci.com/version2/member_detail.php?MemID=21#

Take a look at the bottom where you will find a comments form. In order for the form to be functional it would have to be in .php to be able to get data from the user and post it on the server, no?

Why is it then that when I select view > source, I get an HTML document.

This can also be applied to the actual comments page found here:

http://www.teameci.com/version2/comments.php?MemID=21

Can anyone tell me how this is done?

Thanks.

Posted: Tue May 06, 2003 1:34 pm
by pootergeist
?

I assume you don't quite grasp the intricacies of serverside and clientside languages yet.

the form (shown as html on the client side) is sent to a php script (namely /version2/member_detail.php?MemID=21) - this php script then interprets the form data (on the server side as it should as php is a serverside language), does what it does and output a html response to show to the client on the ........ clientside

Posted: Tue May 06, 2003 1:35 pm
by twigletmac
Have a look at the source of this forum, it too is PHP generated and once again all you will see is HTML (and a bit of JavaScript).

This is because PHP is server-side (ie. evaluated by the server) and thus all that the client (ie. the browser) sees is the generated HTML code.

Mac

Posted: Tue May 06, 2003 1:49 pm
by volka
http://www.php.net/manual/en/introduction.php
What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server. If you were to have a script similar to the above on your server, the client would receive the results of running that script, with no way of determining what the underlying code may be. You can even configure your web server to process all your HTML files with PHP, and then there's really no way that users can tell what you have up your sleeve.
I suggest you start reading from there ;)