Jump to content
xisto Community
Sign in to follow this  
pulsa.batam

What Is Php Description Lounge for beginner PHP Programming

Recommended Posts

PHP is one of many server side languages, others include ASP, PERL and i dont know the rest :(

Basically all that means is that the code is run on the server itself. For example, javascript is downloaded by your browser and then run from your hard drive, so if it had code that said "Delete everything" then YOUR hardrive would be deleted (this isnt really possible, im just highlighting the difference here) but if PHP had the "Delete everything" code and you went to that page then the SERVER's hardrive would be erased.

This is very important because it means PHP can be used for secure things like logins. For example the code would run like this (this isnt real code, just how it would work)

this = password_user_enteredif this=the_real_passwordthen log them inif not chuck them out

So in the example the right password is "the_real_password"

If you were to use that code in javascript all the user would have to do is right click the page, click "view source" and all that code, including the password, would be on display, they just copy and paste the password and theyre in.

But in PHP you wouldnt see a thing!! The only stuff you see from a php page is what i *want* you to see, so i use the ECHO command to show stuff to the browser, i still need to use HTML to format it like so:

this = password_user_enteredif this=the_real_passwordthen ECHO "Welcome to my site"if not ECHO "Wrong password F00L"

So if you enter the right password you get the welcome message, if not you get an error message. Even viewing the source of the pager you would only see the welcome or error message, nothing more. Good times 8)

PHP stands for Hypertext PreProcessor (they just thought php sounded better than hpp) and it does what it says, processes hypertext (HTML) before you see it (thats the pre part) :angel:

Share this post


Link to post
Share on other sites

Actually, PHP originally stood for "Personal Home Page", but now it stands for "PHP: Hypertext Preprocessor". ?Yes, it is a recursive acronym.As for who uses PHP, the answer would be a lot of people. ?For instance, every Wordpress blog is powered by PHP. ?PHP isn't just for hiding passwords and such. ?If I were to build a blog using just HTML, I would have to edit the HTML files every time I made a new blog entry. ?Using PHP, I can write out the structure of a blog post in HTML and leave "blanks" where things such as the title, time of posting, and the content would go. ?Then I can have PHP grab information from a database and fill all those blanks in.To break it down to the simplest level, PHP is code that lets a server write a web page before it sends it to your browser.

Share this post


Link to post
Share on other sites

Tis true, PHP is very powerful, i used the password example to show the differences between client and server side languages.This entire forum (and i believe the shoutbox too) is built with PHP in conjunction with (most likely) a MySql database

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.