Cupidvogel Posted September 19, 2012 Share Posted September 19, 2012 I have noticed that in Stackoverflow, there are basically 4-6 kinds of different URLs. One is for questions, like DOUBLE vs DECIMAL in MySQL. One is for user profile page, like http://stackoverflow.com/users/1469954/cupidvogel. One is for new question, like http://stackoverflow.com/questions/ask, etc. With each page request, the server sends a page as required. Now how do I achieve this on the server side? Should there be one catchall PHP script, which will parse the URL to note what type of page is the client asking (for example, if it parses the URL and finds out that the client is asking for a topic page, it will perhaps extract the question id/text from the URL, query the DB to fetch relevant data, construct the HTTML and send it) and send it accordingly, or should there be separate scripts for each page type? And for either, how do I configure PHP/Apache for this? If I have a page like foo.php, I can see it through http://localhost/foo.php. But if I want it to capture http://localhost/foo.php as well as http://localhost/foo.php/ask/questions, etc, what do I have to do? Quote Link to comment https://forums.phpfreaks.com/topic/268551-how-to-send-differen-pages-from-server/ Share on other sites More sharing options...
trq Posted September 19, 2012 Share Posted September 19, 2012 This is pretty much "dynamic web pages 101". Where exactly are you stuck? Quote Link to comment https://forums.phpfreaks.com/topic/268551-how-to-send-differen-pages-from-server/#findComment-1379224 Share on other sites More sharing options...
Cupidvogel Posted September 19, 2012 Author Share Posted September 19, 2012 I am stuck just at the beginning. That is, say, I have the database designed, and the client side prepared. Now I have to design the PHP. So how do I do it? And what did you mean by This is pretty much "dynamic web pages 101"? Quote Link to comment https://forums.phpfreaks.com/topic/268551-how-to-send-differen-pages-from-server/#findComment-1379225 Share on other sites More sharing options...
Christian F. Posted September 19, 2012 Share Posted September 19, 2012 "Something 101" is a term derived from the US school system, where the first year class you have on any particular subject is called "Something 101". In other words, the question you're asking is as basic as you can get it. Which, in turn means you're basically asking us something that can be equated to "I want to do something I need to know physics for, how can I do physics?" Now, since this is the "PHP coding help" section, you'll have to show us the code you've got so far, along with an explanation of why you've done it, what you expect to get out of it, and what you did get. Otherwise we're unable to help you, as anything we'd say would be pure guesswork on a very wide and general basis. If you're looking for guides on how to create dynamic web pages, then a trip to the "Application Design" section, or (even better) do a search online for tutorials. Quote Link to comment https://forums.phpfreaks.com/topic/268551-how-to-send-differen-pages-from-server/#findComment-1379226 Share on other sites More sharing options...
Cupidvogel Posted September 19, 2012 Author Share Posted September 19, 2012 Thanks. Can you migrate this question to Application Design, or should I ask this question there again? Quote Link to comment https://forums.phpfreaks.com/topic/268551-how-to-send-differen-pages-from-server/#findComment-1379227 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.