View Full Version : quick head tag question
mike21
01-17-2007, 04:09 AM
Hi everyone,
I'm new to php...and can't find anything on "php includes".
example below:
<meta name="keywords" content="<? echo "$keywords1";?>">
I assume that this include is called from a text file. The problem is I can't locate the file...can anyone give me some guidance on what "type" of file I should be looking for or where I might find it?
thetestingsite
01-17-2007, 04:19 AM
Hi everyone,
<meta name="keywords" content="<? echo "$keywords1";?>">
The above would just echo (print in the document) that variable ($keywords1) that was assigned ealier in the script. Not sure what you mean by "What file you should be looking for".
mike21
01-17-2007, 04:40 AM
Thanks for your post....
it sounds like your trying to tell me that the 'description' and 'keywords' would go somewhere in the first 4 lines below? If so, could you advise on exact location?
$description1 = ereg_replace( "\"", "", $description1);
$description1 = ereg_replace( """, "", $description1);
$keywords1 = ereg_replace( "\"", "", $keywords1);
$keywords1 = ereg_replace( """, "", $keywords1);
$today = date ("F-d-Y");
$today1 = date ("F d, Y");
$basecolor = "#ffffff";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><? echo "$sitenames"; ?></title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<base href='<? echo "http://$siteurl_class/";?>'>
<link rel="stylesheet" type="text/css" href="styles.css">
<meta name="description" content="<? echo "$description1";?>">
<meta name="keywords" content="<? echo "$keywords1";?>">
BLiZZaRD
01-17-2007, 07:46 AM
Well, an include does just that; includes code from another place.
So say you have an input form on one page, lets call it input.php and that input box is where the visitor inputs their name: Michael.
Then you could use this information later on on another page.
to use an include you just simply put:
<?php include("http://site.com/input.php"); ?>
Where ever you want the contents displayed on that page.
Becareful though, as includes will include the ENTIRE page.
Perhaps you want Global Variables instead??
it sounds like your trying to tell me that the 'description' and 'keywords' would go somewhere in the first 4 lines below?$description1 and $keywords1 are already defined before that code. Also, the "keywords" meta tag is redundant, as it provides little or no meta-data about the page that would be helpful to a user, and search engines have ignored it for quite a while now. A general rule of thumb is that if it's relevant enough to merit inclusion as a keyword, it should be in the visible text of your page anyway.
mike21
01-17-2007, 04:23 PM
...ok, so where 'in theory' would I insert a name and description for these includes:
<title><? echo "$sitenames"; ?></title>
<meta name="description" content="<? echo "$description1";?>">
...do they usually reside in a text file somewhere or should I be looking for Global Variables?
(there is nothing on the page itself to indicate)
thetestingsite
01-17-2007, 04:43 PM
If they were being assigned from a text file (or any file for that matter), look for something like:
include(), require(), fopen(), file(), or any other file system commands such as these. (For full list, see PHP.net (http://www.php.net/))
Inside the parenthesis (somewhere in there), it would show what file was being included, opened, etc.
Hope this helps.
mike21
01-17-2007, 05:35 PM
....this looks like it may lead somewhere.
global $sitenames, $sitename;
include('paramlinks.inc.php');
...but this file (paramlinks.inc.php) simply references mysql db.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.