i have a homepage that is all php and i wanted to know if i can throw in the meta tag in between the php tags or will it mess it up? liek this... <?php <meta tag> ?> can someone tell me if this would be ok
if you have your var inside your config file you can use is like this config.php $desc= "your site description here"; then in your php script you can use this <META NAME="Description" CONTENT="<?php echo $desc ?>"> is this what you meen
If you don't need it in the php tags then don't put it in them. Either do what cornetofreak suggested or just close php tags and do html. I even do it for IF statements like: <?php if($something) { ?> html without the need for \'s everywhere <?php } ?> Code (markup):
that makes for ugly looking code. He said his whole site is already all php, so just echo "meta tag here"; and your good
You just want to put in keywords right? This page is php just right click and look at the source of this page. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="generator" content="vBulletin 3.6.8" /> <meta name="keywords" content="search engine marketing" /> <meta name="description" content="Search Engine Optimization and Marketing forum." />
How is that ugly? All your doing is adding <? ?> when you want to put some html in. That is less charicters then putting in echo""; and it also saves the need to use \'s everywhere you plan to use quotes. Still, it's down to you how you want to do it
When using html I write it how I write html. I may need to put a ' in the title of an image so would still need \'s The same goes for if I wanted to ad any javascript. At the end of the day, it is each to their own. I am not saying my way is the right way but I offered a suggestion. I know my way works so i am not going to tell people another way am I?