Jump to content

PHP General Questions to understand how things work


purplemonkeyuk

Recommended Posts

Hi PHP Freaks.

 

I'm new to programming PHP.

 

I am learning to code PHP by using textbooks, php.net manuals, and Youtube tutorials.

 

I think I understand the basics by which I mean; PHP is used to communicate and control mySql databases and also display or manipulate stored or user submitted data.

 

What I am struggling to grasp at this point is how PHP works and it's 'living' relationship when used on a website.  By this I mean the following:

 

When I write a form using HTML and set the action to be action="comms.php".

 

The users enters or selects data and then clicks submit.

 

The data is then sent to the comms.php file and PHP assigns the various data submitted to predefined variables. (Ideally configured so it is not venerable to SQL injection)

 

The script is then run using the uniquely defined variables and results are then sent to a results HTML page.

 

On a side note I believe the entirety of the comms.php script should be saved on the sever and referenced to on the HTML page rather than all the PHP code displayed on the actual webpage for security reasons, keeping PHP code from prying eyes.

 

What I don't yet understand is if there are 100 users submitting the search page at the same time how does the single comms.php file cope?  Where is the data that each user has submitted stored whilst the comms.php script is processing the results html page for all of the concurrent users?

 

I am enjoying the learning phase and hope I don't get beaten down too badly for asking a fairly n00b question...

 

Apologies also if it is a long winded questions.

 

Thanks in advance!

 

 

 

Link to comment
Share on other sites

What I don't yet understand is if there are 100 users submitting the search page at the same time how does the single comms.php file cope?

Web servers are designed to handle multiple request at a time.

 

Where is the data that each user has submitted stored whilst the comms.php script is processing the results html page for all of the concurrent users?

They are not processed one at a time, but concurrently. The data is stored in memory until the script no longer needs it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.