scottlpool2003
Mar 9th 2009, 8:36 am
Lol...
It's driving me insane and I really need to do it!
I'm trying to call information from the database and put it in the meta tags...
It works for the title but I get errors when doing it for the tags?
Layout.php
<?php
include('config.php');
function head(){
$home = ($_SERVER['PHP_SELF'] == "/index.php") ? "homehover.png" : "home.png" ;
$new = ($_SERVER['PHP_SELF'] == "/new.php") ? "newhover.png" : "new.png" ;
$genres = ($_SERVER['PHP_SELF'] == "/genres.php") ? "genreshover.png" : "genres.png" ;
echo <<<HERE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7757362-1");
pageTracker._trackPageview();
} catch(err) {}</script>
HERE;
echo '
<title>';
if($_SERVER['SCRIPT_NAME'] == "/preview.php" && $_GET['id'] != 0)
{
$sql = "SELECT `title`,`genre` FROM `films` WHERE `id` = '".mysql_real_escape_string($_GET['id'])."' ";
$res = mysql_query($sql);
$rows = mysql_fetch_assoc($res);
echo "YourOnlineMovies.net | Watch ".$rows['title']." Online | Watch ".$rows['genre']." Movies Online ";
}
else {
echo "YourOnlineMovies.net | Watch Free Movies | Free Online Movies | Free Movies Online";
}
echo'
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
echo "<meta name='keywords' content='".$keywords."' />";
echo "<meta name='description' content='".$description."' />";
echo '<link type="text/css" rel="stylesheet" href="http://youronlinemovies.net/includes/public/stylesheet.css" />
<script type="text/javascript" src="youronlinemovies.net/includes/public/javascript/counter.js"></script>
<script type="text/javascript" src="http://www.youronlinemovies.net/includes/public/javascript/utilities.js"></script>
<script type="text/javascript" src="http://www.youronlinemovies.net/includes/public/javascript/JSON.js"></script>
<script type="text/javascript" src="http://www.youronlinemovies.net/includes/public/javascript/search.js"></script>
<script type="text/javasctipt" src="http://www.youronlinemovies.net/includes/public/javascript/popup.js"></script>
<script type="text/javascript" src="http://www.youronlinemovies.net/includes/public/javascript/bookmark.js"></script>
</head>
<body>
<div id="search">
<form method="post" action="" id="my_search_form" name="search_form">
<p>Search: <input borderstyle="None" type="text" name="search_query" id="search_query" onFocus=clear_search() value="Enter movie title..." size="25"/> </p><center><font color=414141><a href="http://www.youronlinemovies.net/phpBB2/index.php" title="Forum" target="_blank">Login</a> | <a href="http://youronlinemovies.net/phpBB2/profile.php?mode=register" title="Forum" target="_blank">Register</a></font>
</form>
</div>
<center><a href="http://www.youronlinemovies.net" title="Homepage"><img src="http://youronlinemovies.net/includes/public/images/logo.jpg" width="363" height="95"></a> </center>
';
echo "<div id=\"navigation\">
<a href=\"index.php\"><img src=\"http://youronlinemovies.net/includes/public/images/".$home."\" title='Homepage' /></a>
<a href=\"new.php\"><img src=\"http://youronlinemovies.net/includes/public/images/".$new."\" title='New Movies' /></a>
<a href=\"genres.php\"><img src=\"http://youronlinemovies.net/includes/public/images/".$genres."\" title='Movie Genres' /></a>
</div>
<div id='content'>";
}
function footer(){
echo <<<HERE
</div>
<div id="eXTReMe" style="display:none;"><a href="http://extremetracking.com/open?login=12345645" rel="nofollow">
<img src="http://t1.extreme-dm.com/i.gif" style="border: 0;"
height="38" width="41" id="EXim" alt="eXTReMe Tracker" /></a>
<script type="text/javascript"><!--
var EXlogin='12345645' // Login
var EXvsrv='s11' // VServer
EXs=screen;EXw=EXs.width;navigator.appName!="Netscape"?
EXb=EXs.colorDepth:EXb=EXs.pixelDepth;EXsrc="src";
navigator.javaEnabled()==1?EXjv="y":EXjv="n";
EXd=document;EXw?"":EXw="na";EXb?"":EXb="na";
EXd.write("<img "+EXsrc+"=http://e2.extreme-dm.com",
"/"+EXvsrv+".g?login="+EXlogin+"&",
"jv="+EXjv+"&j=y&srw="+EXw+"&srb="+EXb+"&",
"l="+escape(EXd.referrer)+" height=1 width=1>");//-->
</script><noscript><div id="neXTReMe"><img height="1" width="1" alt=""
src="http://e2.extreme-dm.com/s11.g?login=12345645&j=n&jv=n" />
</div></noscript></div>
</div>
</body>
</html>
HERE;
}
?>
Calling them in from preview.php:
<?
$title = 'My title tag for this page';
$keywords = 'my keywords';
$description = 'my description';
?>
It doesn't work and I really can't work out why?
I would willingly kiss anyone who helps me with this, that's how desperate I am lol!
It's driving me insane and I really need to do it!
I'm trying to call information from the database and put it in the meta tags...
It works for the title but I get errors when doing it for the tags?
Layout.php
<?php
include('config.php');
function head(){
$home = ($_SERVER['PHP_SELF'] == "/index.php") ? "homehover.png" : "home.png" ;
$new = ($_SERVER['PHP_SELF'] == "/new.php") ? "newhover.png" : "new.png" ;
$genres = ($_SERVER['PHP_SELF'] == "/genres.php") ? "genreshover.png" : "genres.png" ;
echo <<<HERE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7757362-1");
pageTracker._trackPageview();
} catch(err) {}</script>
HERE;
echo '
<title>';
if($_SERVER['SCRIPT_NAME'] == "/preview.php" && $_GET['id'] != 0)
{
$sql = "SELECT `title`,`genre` FROM `films` WHERE `id` = '".mysql_real_escape_string($_GET['id'])."' ";
$res = mysql_query($sql);
$rows = mysql_fetch_assoc($res);
echo "YourOnlineMovies.net | Watch ".$rows['title']." Online | Watch ".$rows['genre']." Movies Online ";
}
else {
echo "YourOnlineMovies.net | Watch Free Movies | Free Online Movies | Free Movies Online";
}
echo'
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
echo "<meta name='keywords' content='".$keywords."' />";
echo "<meta name='description' content='".$description."' />";
echo '<link type="text/css" rel="stylesheet" href="http://youronlinemovies.net/includes/public/stylesheet.css" />
<script type="text/javascript" src="youronlinemovies.net/includes/public/javascript/counter.js"></script>
<script type="text/javascript" src="http://www.youronlinemovies.net/includes/public/javascript/utilities.js"></script>
<script type="text/javascript" src="http://www.youronlinemovies.net/includes/public/javascript/JSON.js"></script>
<script type="text/javascript" src="http://www.youronlinemovies.net/includes/public/javascript/search.js"></script>
<script type="text/javasctipt" src="http://www.youronlinemovies.net/includes/public/javascript/popup.js"></script>
<script type="text/javascript" src="http://www.youronlinemovies.net/includes/public/javascript/bookmark.js"></script>
</head>
<body>
<div id="search">
<form method="post" action="" id="my_search_form" name="search_form">
<p>Search: <input borderstyle="None" type="text" name="search_query" id="search_query" onFocus=clear_search() value="Enter movie title..." size="25"/> </p><center><font color=414141><a href="http://www.youronlinemovies.net/phpBB2/index.php" title="Forum" target="_blank">Login</a> | <a href="http://youronlinemovies.net/phpBB2/profile.php?mode=register" title="Forum" target="_blank">Register</a></font>
</form>
</div>
<center><a href="http://www.youronlinemovies.net" title="Homepage"><img src="http://youronlinemovies.net/includes/public/images/logo.jpg" width="363" height="95"></a> </center>
';
echo "<div id=\"navigation\">
<a href=\"index.php\"><img src=\"http://youronlinemovies.net/includes/public/images/".$home."\" title='Homepage' /></a>
<a href=\"new.php\"><img src=\"http://youronlinemovies.net/includes/public/images/".$new."\" title='New Movies' /></a>
<a href=\"genres.php\"><img src=\"http://youronlinemovies.net/includes/public/images/".$genres."\" title='Movie Genres' /></a>
</div>
<div id='content'>";
}
function footer(){
echo <<<HERE
</div>
<div id="eXTReMe" style="display:none;"><a href="http://extremetracking.com/open?login=12345645" rel="nofollow">
<img src="http://t1.extreme-dm.com/i.gif" style="border: 0;"
height="38" width="41" id="EXim" alt="eXTReMe Tracker" /></a>
<script type="text/javascript"><!--
var EXlogin='12345645' // Login
var EXvsrv='s11' // VServer
EXs=screen;EXw=EXs.width;navigator.appName!="Netscape"?
EXb=EXs.colorDepth:EXb=EXs.pixelDepth;EXsrc="src";
navigator.javaEnabled()==1?EXjv="y":EXjv="n";
EXd=document;EXw?"":EXw="na";EXb?"":EXb="na";
EXd.write("<img "+EXsrc+"=http://e2.extreme-dm.com",
"/"+EXvsrv+".g?login="+EXlogin+"&",
"jv="+EXjv+"&j=y&srw="+EXw+"&srb="+EXb+"&",
"l="+escape(EXd.referrer)+" height=1 width=1>");//-->
</script><noscript><div id="neXTReMe"><img height="1" width="1" alt=""
src="http://e2.extreme-dm.com/s11.g?login=12345645&j=n&jv=n" />
</div></noscript></div>
</div>
</body>
</html>
HERE;
}
?>
Calling them in from preview.php:
<?
$title = 'My title tag for this page';
$keywords = 'my keywords';
$description = 'my description';
?>
It doesn't work and I really can't work out why?
I would willingly kiss anyone who helps me with this, that's how desperate I am lol!