Thread: Include?

    #1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    England, UK
    Posts
    83
    Rep Power
    15
    I know how to include files:

    <?php include("/path/to/file.php3"); ?>

    How do I include "file.php3?id=1"
    <?php include("/path/to/file.php3?id=1"); ?>
    doesn't work.

    Does anyone know how to do this?

    Girish Gupta
    webmaster@musicgoeson.com
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Seaside, CA
    Posts
    84
    Rep Power
    15
    "How do I include "file.php3?id=1"
    <?php include("/path/to/file.php3?id=1"); ?>
    doesn't work."

    I'm guessing you want to generate a page based on some information in a database (otherwise you wouldn't need the "?id=1."

    To do that, get your variables set up, then:

    <A HREF="file.php?id=$id"><I>Go</I></A>

    Best I can do without knowing what you're trying to achieve with that call.

    ------------------
    From the day we're born, we're running out of time.
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    England, UK
    Posts
    83
    Rep Power
    15
    I've worked it out:

    <?php $id = '1'; include("/path/to/file.php3"); ?>
  6. #4
  7. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    England, UK
    Posts
    83
    Rep Power
    15
    This works but it does something. I get a parse error at the bottom of every page. (is this because I have other include's?)

    I don't understand.

    Help...

    Girish Gupta
    webmaster@musicgoeson.com http://www.musicgoeson.com/
  8. #5
  9. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    England, UK
    Posts
    83
    Rep Power
    15
    No there was an error in my script the way
    to do this is:

    <?php $var = 'var'; include("/path/to/file.php3"); ?>

    Girish Gupta
    webmaster@musicgoeson.com http://www.musicgoeson.com/

Similar Threads

  1. the linker, the include and interdependent classes
    By behco in forum C Programming
    Replies: 7
    Last Post: February 1st, 2004, 08:55 AM
  2. the linker, the include and interdependent classes
    By behco in forum C Programming
    Replies: 0
    Last Post: January 31st, 2004, 01:57 PM
  3. include path problems - after uploading to host
    By alaw in forum PHP Development
    Replies: 2
    Last Post: December 9th, 2003, 06:11 PM
  4. Replies: 6
    Last Post: October 3rd, 2003, 02:01 PM
  5. lnk2001 error msg
    By nobby in forum C Programming
    Replies: 0
    Last Post: August 3rd, 2003, 10:06 AM

IMN logo majestic logo threadwatch logo seochat tools logo