Example link: http://watch-movies.me/tvshows.php?mode=details&id=2158 If you notice the Title of the pages on all my links are the same. I am wondering if someone can help me figure out how to have it display the title of the video that will be played... Sample Code if more is needed please let me know.... <?php session_start(); //==============================all global page settings================================================= $GLOBALS['TitleOfPage']="Movies - Watch TV Shows Online"; $GLOBALS['HeaderPage']="header.php"; $GLOBALS['RightPage']="rightpanel.php"; $GLOBALS['FooterPage']="footer.php"; include("includes/connect.php"); if($_SESSION['LogedInUserId']=="") include("includes/login.php"); include("includes/allfunctions.php"); include("includes/PageStructure.php"); //======================================================================================================= //==========================Some global work /code goes here============================================= //======================================================================================================= //==========================Decision maker will execute for what purpase================================= $_SESSION["MovieType"]="1"; switch ($_REQUEST['mode']) { case "viewsession": $_SESSION['Level']=1; $_SESSION['ShowId']=($_REQUEST['id']!="")?($_REQUEST['id']):($_SESSION['ShowId']); DisplayHtml("DisplayListOfSessions();"); die(); break; case "viewepisode": $_SESSION['Level']=2; $_SESSION['SeassonId']=$_REQUEST['id']; DisplayHtml("DisplayListOfEpisodes();"); die(); break; case "charsrch": DisplayHtml("SearchByChar();"); die(); break; case "latest": DisplayHtml("LatestVideo();"); die(); break; case "addvideo": $_SESSION['Level']=3; if($_REQUEST['srch']=="SearchAppUser") DisplayHtml("DisplayListOfShows();"); else DisplayHtml("AddVideo();"); break; case "savevideo": sendmail(); header("location:tvshows.php"); die(); case "details": $_SESSION['Level']=3; DisplayHtml("VideoDetails();"); die(); break; PHP:
It's easy. Say you keep the name of the video in the $videoname variable. Then remove $GLOBALS['TitleOfPage']="Movies - Watch TV Shows Online"; and add: if(isset($videoname)) $GLOBALS['TitleOfPage']="Movies - Watch TV Shows Online - ".$videoname; (or $GLOBALS['TitleOfPage']=$videoname; ) else $GLOBALS['TitleOfPage']="Movies - Watch TV Shows Online";
put the movie names dynamically into a variable (variable value will be changed with the movie name) and echo it at title area of your php page. ------------------------------------------ Download Free Ebooks
This is a little beyond my knowledge set I can mix stuff around but i suck when it comes to php/mysql Strangely im great in other langs but php is just messy.... ------------------------------------------ Let's say my database is vidsite, table for tv shows is shows_tv and the field for the name of the tv show is showname and the ID is 2158 (my index?) how do I go about calling that on page load, meaning in the header as I assume you can not set the title after this point. (efficiently)..
Am I on the right track here? if($_SESSION['ShowId']=="") { $sql="select * from shows where id=".$_SESSION['ShowId']; $result = mysql_query($sql); $name=mysql_result($result,0,"name"); if(isset($name)) $GLOBALS['TitleOfPage']="My Movies - Watch TV Shows Online - ".$name; } else $GLOBALS['TitleOfPage']="My Movies - Watch TV Shows Online"; PHP: EDIT: This doesnt work going to have top scrap this as its just messing up my site :-s