Thursday, January 22, 2015

first hint of php

I own a domain, and maintain a web hosting account. I should be able to create a social media web site.

In my fantasy, when someone navigates to my home page, they are invited to create a page. They get a page which conveys to them that invitation. If they click "I accept", they get another page which invites them to create a url. To do this they type something into a text box. Little panels pop up that say things like "that url is available" or "that url is not available" or "only letters, numbers, the dash and underscore marks are allowed". Clicking submit ... what does that do? It sends the url to the server. Somehow the server gets "told" that your url has been submitted to it, and then it has to do something with that url. How does the server get told that you have sent it a url and what to do with it?

Although that is a question entirely in itself, a partial answer might be helpful. The domain needs to create a database record for that url.

A kind of pipeline: The submit button on the "create a page" page sends your url to the server along with a "create page" request. The domain, running on the server, gets the request, and creates a new database record.

Do we create a file in file manager that listens for create page requests? Oh, OK, the submit button on the create page page sends the url and the nature of the request to a file on the domain, and whenever that file gets called it collects the request info from the request and creates a database record for the new page. Then it sends the requesting page the content it needs to proceed with whatever the next step is.