SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    *********! *********!!! jackli's Avatar
    Join Date
    Sep 2005
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing Variables via file_get_contents

    I am trying to pass URL variables via file_get_contents("http://url.com/?var1=foo&var2=bar") ... but the variables aren't being passed. Please help!

  2. #2
    SitePoint Evangelist stonedeft's Avatar
    Join Date
    Aug 2009
    Posts
    590
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have you tried:

    $va1 = $_GET['var1'];
    $var2 = $_GET['var2'];

    echo $var1. '<br />'. $var2;
    Don't Panic

  3. #3
    *********! *********!!! jackli's Avatar
    Join Date
    Sep 2005
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that doesn't solve my problem though.. i am trying to send variables via file_get_contents

  4. #4
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,398
    Mentioned
    65 Post(s)
    Tagged
    1 Thread(s)
    What makes you think the variables aren't being passed? Give us a quick test script (for both sending and receiving) which displays this behaviour.
    Salathe
    Software Developer and PHP Manual Author.

  5. #5
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,104
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What I lack in acuracy I make up for in misteaks


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
  •