Mobile app version of vmapp.org
Login or Join
Hamaas447

: Dynamically change page content based on URL parameter? The title of my question seems simple but here is an example of what I want to do: http://www.mayoclinic.com/health/infant-jaundice/DS00107

@Hamaas447

Posted in: #Html #Links #Sitelinks

The title of my question seems simple but here is an example of what I want to do:
www.mayoclinic.com/health/infant-jaundice/DS00107

What happens on that page is whenever you click on a link to go a section (e.g. "Symptoms") in the article on "Infant Jaundice", it provides a URL parameter like this:
www.mayoclinic.com/health/infant-jaundice/DS00107/DSECTION=symptoms

As the DESCTION parameter changes, you get different content on the same page DS00107. The content changes as well as <meta keywords>.

Can someone please tell me how this is achieved? I was thinking it was an if/else situation programmed into the page itself to display different properties depending on the URL parameter.

Any help or suggestions are very much appreciated and my thanks to you for reading my question.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamaas447

1 Comments

Sorted by latest first Latest Oldest Best

 

@Eichhorn148

It seems that the page is using a server-side scripting language, like PHP or ASP.Net to achieve that.

And a Data Base connection to get the diferent content for each section.

As you say, the page display diferent content depending on the URL parameter, but is not he page itself who has the content.

This is what happens:


Client change the section and sends the request to the server (with URL parameters)
The Server look for the URL parameters given.
The Server ask the database for the content that match with the params.
The Server build the page with the content from the DB.
The Server return the generated page to the client.
The Client see an HTML page with the new content.


You can look at this answer in Stackoverflow to get a better idea of the diferences between client and side scripting.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme