November 2, 200817 yr Hi, I have a embedded video website comprised of a main page, with header (head.php). Head.php contains the usual meta info on top. Ex: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>blah blah</title> <meta name="robots" content="index, follow" /> <meta name="revisit-after" content="1 days" /> <meta name="keywords" content="blah blah" /> <meta name="description" content="blah blah " /> The title and keywords on head.php are static when on main page, which is fine with me. Here's my problem/question: When I were to click one of my movie thumbs from the main page, it opens up a viewer page called view_video.php. This page contains a unique title of the video, along with tags (keywords). I want to be able to have the video title appear in <title>blah blah</title> and the tags appear in <meta name="keywords" content="blah blah" />. The title/tags come from mysql database. This way every video page has it's own unique title/keywords for the google bots to crawl. This should help, I've posted my code. head.php : http://pastebin.co.za/650 view_video.php : http://pastebin.co.za/651 Title is defined as: $video['title']; Tags defined as : $video['tags'] Hope someone can figure this one out! Thanks!!
November 2, 200817 yr What parameters are you passing to view_video.php? If you're passing the video id in the url for example, each thumbnail link would look something like this: <a href="view_video.php?vid=1"><img src="mythumbnail.jpg" /></a> Then on view_video.php, check for the vid parameter and pull relevant info from the database. A simple example below: <?php if (isset($_GET['vid'])) { $vid = (int) $_GET['vid']; } $query = "SELECT title, tags FROM videos WHERE vid_id = $vid"; $result = mysql_query($query); if ($result) { $row = mysql_fetch_array($result, MYSQL_ASSOC); } ?> Then spit out the info wherever you want it in your html page: <title> <?php echo $row['title']; ?></title> Sorry if that's not what you meant.
Create an account or sign in to comment