problem with INCLUDE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sylvain Perreault

    problem with INCLUDE

    Hi!

    I have a problem...

    I did a PHP Script for a counter... and I want the counter to be displayed
    on an another PHP page...

    So, I can include it like that:

    <?
    include 'counter.php';
    ?>

    BUT... and here's my problem... the script need more info... like...

    <?
    include 'count/counter.php?sit e=0001&type=2&i mages=1';
    ?>

    when I try this, I get a:

    Warning: Failed opening 'counter.php?si te=0001&type=2& images=1' for
    inclusion (include_path=' .;c:\php4\pear' ) in D:\HTTPD\HTDOCS \count\index.ph p
    on line 24

    both files are in the same directory... can you help me???

    Thanks!

    Desperate Sylvain


  • Andy Jeffries

    #2
    Re: problem with INCLUDE

    On Thu, 11 Sep 2003 08:37:46 -0400, Sylvain Perreault wrote:[color=blue]
    > BUT... and here's my problem... the script need more info... like...
    >
    > <?
    > include 'count/counter.php?sit e=0001&type=2&i mages=1';
    > ?>[/color]

    You'll have to do:

    <?php
    $site='0001';
    $type='2';
    $images='1';
    include 'count/counter.php';
    ?>

    Cheers,



    Andy

    Comment

    • Alex Farran

      #3
      Re: problem with INCLUDE

      Sylvain Perreault writes:

      [color=blue]
      > BUT... and here's my problem... the script need more info... like...[/color]
      [color=blue]
      > <?
      > include 'count/counter.php?sit e=0001&type=2&i mages=1';
      > ?>[/color]

      I think what you want to do here is define a function called counter
      which takes the parameters. Include the function definition at the
      top of the page and call it with your parameters further down.

      --

      __o Alex Farran
      _`\<,_ Analyst / Programmer
      (_)/ (_) www.alexfarran.com

      Comment

      Working...