Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    [m]
    [m] is offline
    New Coder
    Join Date
    Nov 2002
    Location
    Virginia, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do I pass html propertie variables to php.

    is there a way of seting the title of the page without doing this?

    PHP Code:
    <title><?php print("mike page"); ?></title>
    Last edited by [m]; 09-18-2003 at 07:35 AM.
    .:mike:.

    I'm a newbie

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do you mean ?

    There are several ways like http://be.php.net/basic-syntax
    PHP Code:
    <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>
    <?php
    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
    PHP Code:
    <?php
    echo ("<title>mike page</title>");
    ?>
    //or 
    <title><?php echo("mike page"); ?></title>

  • #3
    [m]
    [m] is offline
    New Coder
    Join Date
    Nov 2002
    Location
    Virginia, USA
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    .:mike:.

    I'm a newbie

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •