+ Reply to Thread
Results 1 to 6 of 6

 

Thread: Php Include

  1. #1
    thin[box]king

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cambridge
    Posts
    1,905
    Thanks
    13
    Thanked 12 Times in 12 Posts


    Hi I want to inculde a php file into a php script
    include('file.php');
    but I would like to add a filter ie
    include('file.php?filter='.$filter);

    This doesnt work, how can I over come this?

    Cheers
    Follow Me | Looking for Merchants Who Do Scifi Stuff

  2. #2
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    tried:

    include("file.php?filter=$filter");

    ?
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  3. #3
    Avoiding real work

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Buckinghamshire
    Posts
    1,373
    Thanks
    0
    Thanked 0 Times in 0 Posts
    and if Dan's suggestion doesn't work, try including the whole url -

    include('http://www.yoursite.co.uk/file.php?filter=$filter');

    I'm sure I read somewhere that if you just include the filename then it isn't parsed properly, so it looks for a file called 'file.php?filter=$filter'

  4. #4
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    Ian, I always thought that if you wanted to output a $thing, sorry don't really know what there called strings, variables, arrays?

    That they had to be inside speach marks (") rather than just ('), have a funny feeling that if u use (')'s it will literally include:

    http://www.yoursite.co.uk/file.php?filter=$filter

    Rather than replacing $filter with the actual filter, scifind if my first sugestion doesn't work try what Ian said with (")'s instead of (')'s.

    If all that makes sence to you well done.

    Edit: Poor typing
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays

  5. #5
    Registered User

    Status
    Offline
    Join Date
    Jul 2003
    Posts
    71
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    Just set the $filter var before the include !

    e.g.

    <?php

    $fliter="yes";
    include ("filename.php");

    ?>

    Cheers

  6. #6
    thin[box]king

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cambridge
    Posts
    1,905
    Thanks
    13
    Thanked 12 Times in 12 Posts
    Hi
    I thought that was how to do it ( I was sure I have used all ways befroe)
    There was a problem with the script in question so it wouldn't apply the filter (a silly mistake of mine, updating and uploading an older version of the script
    Follow Me | Looking for Merchants Who Do Scifi Stuff

+ Reply to Thread


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Anyone anygood with xml, php, mysql and Affiliate Window
    By AnnonnyMouse in forum Affiliate Marketing Lounge
    Replies: 1
    Last Post: 23-09-04, 12:00 PM
  2. PHP - No input file specified. - Problem
    By Barry in forum Programming
    Replies: 1
    Last Post: 02-08-04, 11:57 AM
  3. PHP or Browser Timeout?
    By Barry in forum Programming
    Replies: 6
    Last Post: 28-04-04, 02:04 PM
  4. PHP File Security for Includes
    By bonedome in forum Programming
    Replies: 0
    Last Post: 01-01-04, 09:11 AM
  5. Including a PHP include within a PHP include ??
    By madstock in forum Programming
    Replies: 3
    Last Post: 17-12-03, 10:00 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
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2