Understanding PHP: What is It & Why Do We Need It?

  • PHP
  • Thread starter Dave Ritche
  • Start date
  • Tags
    Php
In summary: If you have a static website that just displays things, there is no need for PHP.If you have an interactive web site, then PHP is one of many tools you can use for code creation. PHP also integrates well with SQL, so it's useful if your website requires some database processing.My site isn't interactive and doesn't use any databases, but I nevertheless use PHP. First, it let's me adjust internal links automatically so that they work properly both on the server on my home computer, and on my public web hosting provider. This let's me develop and test new pages completely on my home computer before uploading them and making them public. Second, I can use an "include file" to insert code that
  • #1
Dave Ritche
70
6
I'm really stuck at knowing about PHP..
What will happen without using PHP on your website?
I know it's server side but why we need it?to process forms?how PF uses PHP?
 
Technology news on Phys.org
  • #2
If you have a static website that just displays things there is no need for PHP. If you have an interactive web site, then PHP is one of many tools you can use for code creation.
 
  • Like
Likes Silicon Waffle
  • #3
PHP also integrates well with SQL, so it's useful if your website requires some database processing.
 
  • Like
Likes Silicon Waffle
  • #4
My site isn't interactive and doesn't use any databases, but I nevertheless use PHP. First, it let's me adjust internal links automatically so that they work properly both on the server on my home computer, and on my public web hosting provider. This let's me develop and test new pages completely on my home computer before uploading them and making them public. Second, I can use an "include file" to insert code that's the same on each page, so if I ever need to change that stuff, I don't have to edit every single page.

In practice the pages look mostly like ordinary HTML and CSS, with a little bit of PHP code sprinkled in.
 
  • Like
Likes Silicon Waffle
  • #5
Dave Ritche said:
...
I know it's server side but why we need it?to process forms?how PF uses PHP?
As people explained, it is mostly for interactive web sites. For instance, on PF you will have users and their roles, all of which are defined and stored also their credentials in one or more databases; so your posts, your profiles, etc can be edited, remembered and available for search by the system and other users.
To process a form, your client will send a request that contains his intent to the server. PHP will help you to extract the sent data and process/store them for particular purpose depending on your design and make a response after everything is successfully done. Today such a request-response model is re-formed via use of RESTful web-services.
 
  • Like
Likes Dave Ritche and Samy_A

1. What is PHP and what does it stand for?

PHP is a scripting language used for web development. It stands for "Hypertext Preprocessor".

2. What are the main features of PHP?

Some main features of PHP include its ability to interact with databases, manipulate files on a server, and generate dynamic content on web pages.

3. Why is PHP important for web development?

PHP is important for web development because it allows for the creation of dynamic and interactive web pages, making websites more engaging and user-friendly.

4. How is PHP different from other programming languages?

PHP is specifically designed for web development and is often used in conjunction with HTML and CSS. It is also an open-source language, meaning it is free to use and has a large community of developers constantly improving and updating it.

5. Can PHP be used for both front-end and back-end development?

Yes, PHP can be used for both front-end and back-end development. It is commonly used for back-end development to handle server-side tasks, but can also be used for front-end development to create dynamic web pages.

Similar threads

  • Programming and Computer Science
6
Replies
187
Views
8K
  • Programming and Computer Science
Replies
21
Views
5K
  • Programming and Computer Science
Replies
1
Views
715
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
13
Views
2K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
7
Views
6K
  • Programming and Computer Science
Replies
12
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
22
Views
4K
Back
Top