SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Smart programmer silver trophy M.Zeb Khan's Avatar
    Join Date
    Jan 2004
    Location
    Luton, Beds
    Posts
    1,791
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Query string in the include()?

    Hi,

    Anyway where we can pass variables in the inclue()?

    like,
    PHP Code:
     include("index.php?show=thatPage"); 

  2. #2
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why would you ever want to do that? That's really dangerous...

  3. #3
    SitePoint Wizard Young Twig's Avatar
    Join Date
    Dec 2003
    Location
    Albany, New York
    Posts
    1,355
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $_GET['show'] = 'thatPage';
    include(
    'index.php'); 

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You really should read the manual.
    http://www.php.net/include/

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Location
    N. Vancouver, BC, Canada
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Young Twig View Post
    PHP Code:
    $_GET['show'] = 'thatPage';
    include(
    'index.php'); 
    Thanks!
    -Colin

  6. #6
    Floridiot joebert's Avatar
    Join Date
    Mar 2004
    Location
    Kenneth City, FL
    Posts
    823
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not like you have it there, but if you're using a protocol wrapper, like HTTP, you can.

    PHP Code:
    include 'http://domain.com/?one=1&two=2'
    Other than that, why would you need to ?


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
  •