Jump to content

Recommended Posts

It's to my understanding that you don't have to have all the webpages stored on your servers.  There are pages that are generated dynamically and you can link to it with a question mark after "php". 

 

For example, if you go to google.com and do a search, the result page url will have a question mark, like this:

http://www.google.com/search?hl=en&q=test&btnG=Google+Search

 

How does this work?  An example would be really helpful.  Thanks a lot.

 

Link to comment
https://forums.phpfreaks.com/topic/83437-how-do-i-generate-page-with-php/
Share on other sites

What dynamic pages usually do is take those variables from the url using the $_GET superglobal.

 

If you have page.php?var=3, you do $_GET['var'] to get 3 and you run that through your DB to generate the data for the page.

 

It is pretty simple once you understand the basic idea.

 

website.com/page.php?user=jaguaar

 

SELECT * FROM user WHERE user_name = $_GET['user'] //dont ever do this, but here is an example of how you can use it

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.