Bluehost.com Web Hosting $6.95

RE: [PHP] How to use ph to set meta tags ?

This is a discussion on RE: [PHP] How to use ph to set meta tags ? within the PHP General forums, part of the PHP Programming Forums category; <?php function mAuthor() { $Author = 'Daniel Szasz'; print $Author; }; ?> Then use: META NAME="Author" CONTENT="<? ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-15-2003
Johnny Martinez
 
Posts: n/a
Default RE: [PHP] How to use ph to set meta tags ?

<?php
function mAuthor() {
$Author = 'Daniel Szasz';
print $Author;
};
?>

Then use:
META NAME="Author" CONTENT="<? mAuthor(); ?>">

Notice I replaced
$Author = "Daniel Szasz";
with
$Author = 'Daniel Szasz';

This tells php to just assign the value to the variable and not to bother
performing any interpretation on it. This speeds up your script
intepretation. You also forgot the ';' in the html/php statement for the
Meta Name.

HTH,
Johnny

-----Original Message-----
From: Daniel Szasz [mailto:danysz@yahoo.com]
Sent: Tuesday, July 15, 2003 12:07 PM
To: php-general@lists.php.net
Subject: [php] How to use ph to set meta tags ?


Hello

I wish to create be able to put in the meta tags value from functions.
How can be done ?

Here is part of the code :


<?php
function mAuthor() {
$Author = "Daniel Szasz";
return $Author;
};
?>


<?

?>

<HTML>
<HEAD>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">

<META NAME="mAuthor" CONTENT= <? mAuthor() ?> >
</HEAD>
</HTML>

Thanks a lot for the help

Daniel




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:28 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0