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. Quote 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 Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/36810-solved-url-variable-_get/#findComment-175614 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.