Jump to content

Recommended Posts

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

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

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.