Results 1 to 3 of 3

 

Thread: php http get request

  1. #1
    Super Member

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


    having a bit of trouble with this, basically I have a url that if I paste into my browser it works and gives the correct output.

    however if I put the url in to a php script something like...

    PHP Code:
    $content file_get_contents($url);
    echo 
    $content
    where $url is the same url I would paste into the browser, the php output is...

    Warning: file_get_contents(#url#): failed to open stream: HTTP request failed!

    Where #url# is my $url fro mthe script. So it works, the script that its requesting gives the correct output but only via a browser call not a php one. Done a few searches about it but not getting anywhere

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

  2. #2
    Member

    Status
    Offline
    Join Date
    Mar 2004
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    do you pass any variables in the URL, that need to be urlencode() can you pm a sample of the URL? If there are any spaces etc in the URL they need to encoded

  3. #3
    Super Member

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Costa Del Sheffield
    Posts
    2,838
    Thanks
    5
    Thanked 18 Times in 14 Posts
    one damn space! Cant believe id missed that, cheers
    Dan Morley
    alpharooms.com
    daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
    My Blog | Cheap Holidays



Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Internal PHP Processing Error (#99911)
    By Donk in forum Programming
    Replies: 1
    Last Post: 20-02-06, 04:50 PM
  2. HTTP POST in PHP
    By chs in forum Programming
    Replies: 5
    Last Post: 20-02-06, 12:22 PM
  3. Anyone anygood with xml, php, mysql and Affiliate Window
    By AnnonnyMouse in forum Affiliate Marketing Lounge
    Replies: 1
    Last Post: 23-09-04, 11:00 AM
  4. PHP - No input file specified. - Problem
    By Barry in forum Programming
    Replies: 1
    Last Post: 02-08-04, 10:57 AM
  5. PHP or Browser Timeout?
    By Barry in forum Programming
    Replies: 6
    Last Post: 28-04-04, 01:04 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