PHP Question
Results 1 to 4 of 4

Thread: PHP Question

  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Stockholm
    Posts
    188

    PHP Question

    If I write
    include $hello
    The page includes page.php?hello=page1.php

    But if I write

    include $hello + ".php"
    it tries to include zero.

    Why?

    Thanks,
    Bjorne

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    Stockholm
    Posts
    188
    include $hello . ".php"
    is the correct version

  3. #3
    Registered User +Daemon+'s Avatar
    Join Date
    Jan 2002
    Location
    RC, Ca
    Posts
    3,406
    to use include do this

    PHP Code:
    <?
    include($hello);
    ?>
    or
    PHP Code:
    <?
    require($hello);
    ?>
    now to add two varibles or a varible with text you do this

    PHP Code:
    <?
    //Variable with variable
    $var2 $hello.$var;

    //Variable and text
    $var $var2."this is text";
    ?>
    so if you want to add the extition on $hllo do this

    PHP Code:
    <?
    include($hello.".php");
    ?>

  4. #4
    Registered User C0NF0RTY's Avatar
    Join Date
    Jul 2001
    Location
    Israel,Raanana
    Posts
    88
    PHP!==Javascript

    U also can do something like this and probably this is easiest way
    PHP Code:
    $var='name'
    echo "$var and txt"#prints name and txt
    echo '$var and txt'#prints $var and txt 
    ~Say FiQ
    Last edited by C0NF0RTY; July 5th, 2003 at 07:10 PM.

Bookmarks

Posting Permissions

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