thirteen13 Posted April 14, 2010 Share Posted April 14, 2010 I need to display different content according to the URL of the website. For example: If the url is: http://test.com/page.php?id=10&p=17&s=25&i=26 then the html displays <p>This is the first page</p> If the url is: http://test.com/page.php?id=10&p=18&s=109&i=104 then the html displays <p>This is the second page</p> How can it be done? Link to comment https://forums.phpfreaks.com/topic/198488-change-content-according-to-url/ Share on other sites More sharing options...
Deoctor Posted April 14, 2010 Share Posted April 14, 2010 depending on which item u need to change that Link to comment https://forums.phpfreaks.com/topic/198488-change-content-according-to-url/#findComment-1041532 Share on other sites More sharing options...
thirteen13 Posted April 14, 2010 Author Share Posted April 14, 2010 The content changes according to url. Link to comment https://forums.phpfreaks.com/topic/198488-change-content-according-to-url/#findComment-1041534 Share on other sites More sharing options...
Deoctor Posted April 14, 2010 Share Posted April 14, 2010 not understood dude.. in the examples u gave it is some thing like depending the query string ur are changing it out.. in the string u have four different items so on which value u need to change this?? Link to comment https://forums.phpfreaks.com/topic/198488-change-content-according-to-url/#findComment-1041536 Share on other sites More sharing options...
thirteen13 Posted April 14, 2010 Author Share Posted April 14, 2010 I want one php script which gets the URL and displays 'This is the first page' if the page visited is 'http://test.com/page.php?id=10&p=17&s=25&i=26' and to display 'This is the second page' if the page visited is 'http://test.com/page.php?id=10&p=18&s=109&i=104' Link to comment https://forums.phpfreaks.com/topic/198488-change-content-according-to-url/#findComment-1041548 Share on other sites More sharing options...
Deoctor Posted April 14, 2010 Share Posted April 14, 2010 then do some thing like this $id=$_GET['id']; like this get the values and using if condition echo different messages.. Link to comment https://forums.phpfreaks.com/topic/198488-change-content-according-to-url/#findComment-1041557 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.