Is this .PHP or what?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
zeno
Forum Newbie
Posts: 1
Joined: Tue May 06, 2003 1:28 pm

Is this .PHP or what?

Post 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.
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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 ;)
Post Reply