d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Php Question
Add Reply New Topic New Poll
Member
Posts: 31,293
Joined: Mar 25 2009
Gold: 0.00
Mar 19 2018 09:10pm
What are phps primary uses? and can java or python do everything php can? Thanks so much!!
Member
Posts: 6,037
Joined: Apr 6 2008
Gold: 36.00
Mar 19 2018 10:59pm
php is mainly used for back-end web development. It does server-side data manipulations. It is pretty much only used for generating web pages, but there are ways you can use it for non-web-related things, but it is rarely the best choice.

A very basic use of php would be to handle the inputs from an html form (you may want to start here as a first example). HTML doesn't have variables, so you need to use things like PHP or JavaScript to do anything other than serve a static web page.

I mainly use php to do file manipulations on a web server and to interact with a database to handle data input/output on a web page.

PHP stands for Hypertext Preprocessor, whereas HTML is Hypertext Markup Language. php code is executed before the web page fully loads and generates the HTML dynamically, based on different factors (who you are, location, requested language, login state, permissions, etc).

This forum is built using php (notice the .php in every page URL, instead of .html). So basically, things like your username at the top left, how much gold you have, etc, are pulled from d2jsp's database using (maybe SQL, but there are other popular DB query languages) calls using php and stored in variables. These variables are then used in the HTML as it is created.


Yes, java and python can technically do everything php can in terms on serving a webpage. I would recommend using php in the majority of cases, but they can all be used almost equivalently.

This post was edited by rx7drifter on Mar 19 2018 11:00pm
Member
Posts: 31,293
Joined: Mar 25 2009
Gold: 0.00
Mar 19 2018 11:01pm
Quote (rx7drifter @ Mar 20 2018 12:59am)
php is mainly used for back-end web development. It does server-side data manipulations. It is pretty much only used for generating web pages, but there are ways you can use it for non-web-related things, but it is rarely the best choice.

A very basic use of php would be to handle the inputs from an html form (you may want to start here as a first example). HTML doesn't have variables, so you need to use things like PHP or JavaScript to do anything other than serve a static web page.

I mainly use php to do file manipulations on a web server and to interact with a database to handle data input/output on a web page.

PHP stands for Hypertext Preprocessor, whereas HTML is Hypertext Markup Language. php code is executed before the web page fully loads and generates the HTML dynamically, based on different factors (who you are, location, requested language, etc).

This forum is built using php (notice the .php in every page URL, instead of .html). So basically, things like your username at the top left, how much gold you have, etc, are pulled from d2jsp's database using (maybe SQL, but there are other popular DB query languages) calls using php and stored in variables. These variables are then used in the HTML as it is created.


Yes, java and python can technically do everything php can in terms on serving a webpage. I would recommend using php in the majority of cases, but they can all be used almost equivalently.


Gotchya that makes sense, thanks so much! :)
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Mar 20 2018 12:32pm
php is mostly used by people who don't know any better. And masochists i guess?

Everything php does can be done better, easier, faster and more efficiently in other languages. php - "training wheels without the bike"
Member
Posts: 2,754
Joined: Nov 26 2007
Gold: 1,339.81
Mar 20 2018 01:42pm
Quote (nuvo @ Mar 20 2018 02:32pm)
php is mostly used by people who don't know any better. And masochists i guess?

Everything php does can be done better, easier, faster and more efficiently in other languages. php - "training wheels without the bike"


this ^
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll