Page 1 of 1
Meta Tags
Posted: Tue Mar 08, 2005 6:10 pm
by JF3000
I dont quite understand php nor how it works, so I wanted to ask can html be placed inside those tags of php, or does the html have to reside on the outside of the tags of php?
I ask this as I wanted to know where to place meta-tags for the index.php?
Thank you.
JF3000
Posted: Tue Mar 08, 2005 6:35 pm
by feyd
depending on how you do it, either works. 'echo' will send to the client whatever you give it, whether it appears like you wish is up to how you use it. They can be placed outside <?php ?> similarly.
Posted: Wed Mar 09, 2005 9:29 pm
by Ambush Commander
A note about meta tags, sometimes they're changing the "Headers" of a page. You can do much smoother redirects, for instance, if you have PHP send the redirect header straight from the code, not the Meta tag.
Posted: Wed Mar 09, 2005 9:33 pm
by feyd
although one should send a meta-tag enabled redirect page incase the browser (or proxy) disallows or does not support the header redirection.

Posted: Wed Mar 09, 2005 10:06 pm
by d3ad1ysp0rk
feyd wrote:although one should send a meta-tag enabled redirect page incase the browser (or proxy) disallows or does not support the header redirection.

and even include a link if the browser doesn't like meta redirects..
Posted: Wed Mar 09, 2005 10:11 pm
by feyd
quite true.
Posted: Wed Mar 09, 2005 10:38 pm
by d3ad1ysp0rk
Yuck for "user options"

Posted: Thu Mar 10, 2005 9:27 am
by JF3000
I thank you for your posts, but being new to php I am lost.
I created some meta tags and just placed them above my php tags at the top of the php page, will this do fine or is there a better method because I am using php?
Thank you.
Posted: Thu Mar 10, 2005 10:07 am
by Chris Corbyn
That'll do.
Just because you are using PHP, doesn't mean you should echo / print stuff for the sake of it.
If you can do it outside of the <?php ?> tags then that's the best (and I beleive fastest) way to do.
Examples:
Code: Select all
//Doing it outside <?php ?>
<?php
$name = 'Chris';
$age = '21';
?>
<!-- This is HTML -->
<span>My name is <?php echo $name; ?> and I am <?php echo $age; ?> years old.</span>
//Doing it all inside <?php ?>#
<?php
$name = 'Chris';
$age = '21';
echo '<span>My name is ';
echo $name;
echo ' and I am ';
echo $age;
echo ' years old.</span>';
?>
You can echo anything, be it, words, <tags>, JavaScript or anything that shows in the web page source code. Just depends if you needs to use the PHP to do it or not. I do it outside of <?php ?> wherever possible (if it's not dynamic content).
Posted: Thu Mar 10, 2005 7:47 pm
by batfastad
Sorry this is a bit far down but...
Using PHP redirects I've had trouble getting them to work with AOL, despite them working with most other browsers.
As said above, always have a meta redirect there just in case.
Posted: Thu Mar 10, 2005 8:03 pm
by feyd
be aware that relative header redirects are a somewhat recent addition to support on browsers. Some may still only support full URI's. This may explain the batfastard's problem with AOL.. although I don't know what their browser supports directly