Trying to make my site more SEO friendly...

Discussion in 'PHP' started by LilPutian, Sep 25, 2008.

  1. #1
    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:
     
    LilPutian, Sep 25, 2008 IP
  2. Warden

    Warden Peon

    Messages:
    22
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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";
     
    Warden, Sep 25, 2008 IP
  3. linkexchange1984

    linkexchange1984 Peon

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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
     
    linkexchange1984, Sep 25, 2008 IP
  4. LilPutian

    LilPutian Well-Known Member

    Messages:
    250
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #4
    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)..
     
    LilPutian, Sep 25, 2008 IP
  5. LilPutian

    LilPutian Well-Known Member

    Messages:
    250
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #5
    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
     
    LilPutian, Sep 25, 2008 IP
  6. hardevzala

    hardevzala Banned

    Messages:
    228
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    php admin panel is good for make it seo friendly
     
    hardevzala, Sep 26, 2008 IP
  7. LilPutian

    LilPutian Well-Known Member

    Messages:
    250
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #7
    What do you mean exactly?

     
    LilPutian, Sep 26, 2008 IP