View Full Version : how do I pass html propertie variables to php.

09-18-2003, 05:38 AM
is there a way of seting the title of the page without doing this?

<title><?php print("mike page"); ?></title>

09-18-2003, 08:59 AM
What do you mean ?

There are several ways like http://be.php.net/basic-syntax

<title><?php_echo("mike page"); ?></title>
<title><?_print("mike page"); ?></title> //USE OF SHORT TAGS IS DICOURAGED !
<title><?_echo("mike page"); ?></title>
<title><?=_print("mike page"); ?></title>
<title><%_print("mike page"); %></title>
echo ("<title>mike page</title>");

Or do you mean to dynamically insert it from a db or so ?

My opinion : do not use short tags (not all servers will have them enabled so your application could go belly up if you switch server). Do not use the ASP tags (%). Use what most coders use so that most coders can easely read and help you with your code. Try to not switch in and out PHP-mode --> easier to read + should have a tiny bitty piece of small performance advantage.

So for me it's

echo ("<title>mike page</title>");
<title><?php echo("mike page"); ?></title>

09-18-2003, 09:13 PM
no what I mean is, is there a way to pass the page properties like bgcolor and title so that I can check it in php, sorry b4 I had said html . or start the page off by. I have been at it for a while but can't find what I'm looking for. how it is escaped doesn't reaqlly matter to me I will be useing <?php from now on

09-18-2003, 10:00 PM
Hmm. I don't understand it.

Check it in PHP ? What do you mean by that ?

PHP doesn't check html. For the parser, everything outside PHP tags isn't taken into account.
You can dynamicaly insert pagetitles form a database or from the querystring or grab the filename and insert that as title or so, but check it in PHP ?