purplemonkeyuk Posted July 8, 2013 Share Posted July 8, 2013 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! Quote Link to comment Share on other sites More sharing options...
trq Posted July 8, 2013 Share Posted July 8, 2013 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. Quote Link to comment Share on other sites More sharing options...
purplemonkeyuk Posted July 8, 2013 Author Share Posted July 8, 2013 Thank you very much TRQ, helps outs I appreciate it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.