Understanding PHP

  • PHP
  • Thread starter Dave Ritche
  • Start date
  • #1

Main Question or Discussion Point

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?
 

Answers and Replies

  • #2
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
16,178
6,188
If you have a static web site 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
3,379
943
PHP also integrates well with SQL, so it's useful if your website requires some database processing.
 
  • Like
Likes Silicon Waffle
  • #4
jtbell
Mentor
15,552
3,507
My site isn't interactive and doesn't use any databases, but I nevertheless use PHP. First, it lets 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 lets 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
156
203
...
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

Related Threads on Understanding PHP

  • Last Post
Replies
6
Views
3K
  • Last Post
Replies
12
Views
839
  • Last Post
Replies
8
Views
6K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
4
Views
5K
  • Last Post
Replies
9
Views
1K
  • Last Post
2
Replies
40
Views
19K
  • Last Post
Replies
8
Views
4K
Replies
4
Views
3K
  • Last Post
Replies
4
Views
3K
Top