SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Ottawa, Canada
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    require("file.php") with values??????

    Is it possible to send values in the require line?
    like so..... maybe???

    require("file.php?val=123&val2=456");

    this does not work
    Am I going about it wrong?
    Is there a way that this could get done differently?



    thanks in advance!
    thanks,
    brennen

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try just setting those variables before you require the file.

  3. #3
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Ottawa, Canada
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sending values without a require

    the only way I have sent values between pages is in href tags as links, i.e.
    <a href http://site/file.php?val=123&val2=456>blahblah</a>

    So if I were to send the values before the require, how would that be done, if I don't want to use links?

    you follow????
    thanks,
    brennen

  4. #4
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php
    $val1 ="1234";
    $val2 = "567";
    ?>

    Like that!

  5. #5
    SitePoint Evangelist CyberFuture's Avatar
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Brennen,

    I think you're missing the point. You don't need to send the variables to the required file because it becomes part of the file that required it. This is why you must declare the variable values before you make the require statement.

    Give it a try.

  6. #6
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Ottawa, Canada
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    riiiiiiiiiiiiiiiiiiiiiiiiiiiight

    thanks,

    thats exactly what I needed to know
    thanks,
    brennen


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
  •