Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 117,572 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,844 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Whats the use of PHP?

 
Reply to this topicStart new topic

Whats the use of PHP?

Sn0wm4n
post 14 Jul, 2008 - 09:32 PM
Post #1


New D.I.C Head

*
Joined: 8 Jul, 2008
Posts: 11


My Contributions


I was looking into getting into internet languages such as HTML, XML, PHP, Javascript, etc. but as I started to crack the surface of PHP, I wondered how you could use it since it was a server-side language. So how can you use it without turning your computer into a web server? Also can you guys just kind of give me an overview of what different internet languages are good for because I read briefly that PHP is good for tapping into databases (whatever that means(I really don't know what that means...)).
User is offlineProfile CardPM

Go to the top of the page


grimpirate
post 14 Jul, 2008 - 09:47 PM
Post #2


D.I.C Head

Group Icon
Joined: 3 Aug, 2006
Posts: 177



Thanked 5 times

Dream Kudos: 375
My Contributions


The use of a server side language grants a website owner (like yourself presumably) to interact with visitors to his site. For instance, I don't know how much knowledge of the internet you have, but one of the most basic methods of interaction is through the use of a form (like the one you use to make posts here on dreamincode. Javascript works client side, so it's like Flash or other technologies that do nifty things on the person's computer. However, it's of no use to the person who made the site. Server side languages like PHP give you the ability to get info from your users. Here in dreamincode for instance that information would be stuff like your username and age and hobbies and where you're making posts and such. That data that is taken from the user needs to be stored somehow, and that is typically what databases are used for. If we didn't have that technology, then webpages would be uniquely static, like books, and would never update until a new version of the site (i.e. book) was uploaded to the net. Dynamically updated websites like dreamincode for instance don't need to be reuploaded all the time. They simply update their database and display the results accordingly through the use of some server-side scripting language (I'm unsure if dreamincode uses PHP or not).
User is offlineProfile CardPM

Go to the top of the page

Mike007
post 14 Jul, 2008 - 10:50 PM
Post #3


D.I.C Head

Group Icon
Joined: 30 Aug, 2007
Posts: 200



Dream Kudos: 75
My Contributions


You can just run the interpreter and get the resulting output, you do not really need a server. But for it to be useful you will probably need to link it to some sort of a server. A good use for it that is outside the scope of a "normal webpage" is for example when you create a script to update a database every X amount of time. You can do it by running a scheduled task or a CORN job like the linux people like to call it executing the php executable (php.exe in windows again) and passing the file name as a parameter.

But anyway PHP is used to link between the web user and the server to accomplish a certain task beyond simple retrival of static information. Therefore this makes pages dynamic. PHP is usually used together with mysql database. It allows a company to connect it's database to the internet from a business prospective. But it is not limited to using databases, it can also process files, images, text etc. It is good when you need to make a webpage response to a request from the user that requires more, updated or new information to be sent from your server. Remember, PHP is always compiled on the server, the user never sees the code and has permission to do things that simple users are not supposed to be allowed to do in order to accomplish a task. Therefore, it helps them complete the task without compromising security.

overview of other languages:

Javascript- a client-side scripting language that runs on the local computer or the client in order to accomplish a specific task that does not involve directly accessing the server but rather may need to access local resources instead. E.g. visual effects, simple data validation and user interface functions.
[indent]AJAX- a javascript technology that allows to get additional information from the server after the page as loaded without reloading the entire page.

HTML or the newest version XHTML- a descriptive markup language that describes where stuff are on the page and what they do and can also describe how they look like.

CSS- a language that describes how exactly stuff look like. And should be used together with XHTML, although HTML itself has the power to decide what things will look like.

XML- a markup language to facilitate data exchange among programs or people. This language describes what data is, giving it context which turns it into information that can be useful. It simplifies data exchange among different parties by alot by providing standards and explaining what it should contain.

This post has been edited by Mike007: 14 Jul, 2008 - 10:51 PM
User is offlineProfile CardPM

Go to the top of the page

akozlik
post 15 Jul, 2008 - 09:50 AM
Post #4


D.I.C Addict

Group Icon
Joined: 25 Feb, 2008
Posts: 527



Thanked 19 times

Dream Kudos: 750
My Contributions


Here's a pretty good article that should explain it

http://php.about.com/od/phpbasics/ss/php_mysql.htm
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 08:30PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month