johnwayne77 Posted February 2, 2007 Share Posted February 2, 2007 I have this url: http://www.imobconsulting.ro/tv/main.php?program=ngc where the value of program changes (for ex.: ngc, ers, prm, mtv ) good... now I want to display the title for each page according to the program= option selected. For example if the url is: http://www.imobconsulting.ro/tv/main.php?program=ngc I want the title to be National Geographic or if it is http://www.imobconsulting.ro/tv/main.php?program=mtv then I would want Music Television how do I do that? I believe I have to define some variables somewhere and use the IF statement? Help would be greatly appreciated. Thanks. Link to comment https://forums.phpfreaks.com/topic/36810-solved-url-variable-_get/ Share on other sites More sharing options...
pikemsu28 Posted February 2, 2007 Share Posted February 2, 2007 use $_REQUEST['variable'] to pull the variable from the url. you then can run an if statement and set the title of the page according to the variable that was passed to the url. $var = $_REQUEST['program'] if($var == 'blah') { echo "blah"; } else if($var == '....') echo "...."; } else if.....so on Link to comment https://forums.phpfreaks.com/topic/36810-solved-url-variable-_get/#findComment-175604 Share on other sites More sharing options...
johnwayne77 Posted February 2, 2007 Author Share Posted February 2, 2007 works! thanks dude! Link to comment https://forums.phpfreaks.com/topic/36810-solved-url-variable-_get/#findComment-175614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.