Jump to content

PHP coding help needed


cashbagg

Recommended Posts

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.

 

My site is adult, NSFW. I think you will need to view it's source in order to help me out. Please reply to this and I will PM you the URL to peruse, or the actual php files themselves.

 

thanks.

 

 

Link to comment
https://forums.phpfreaks.com/topic/130899-php-coding-help-needed/
Share on other sites

You would do something like

 

<?php
//  Create query to select title and tags
$query = "SELECT title, tags FROM table WHERE video = '$video'";

//  Query the database
$result = mysql_query($query) or die mysql_error();

//  Get the data.
$row = mysql_fetch_row($result);

//  This will get the title
echo $row[0];

//  This will get the tags
echo $row[1];
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.