Closed Thread
Results 1 to 5 of 5

Thread: Basic GET request PHP problems

  1. #1
    Coldblackice is offline Newbie
    Join Date
    Feb 2009
    Posts
    9
    Rep Power
    0

    Basic GET request PHP problems

    I'm trying to connect to a url and grab the contents of the main page (slickdeals.net). When I try to solely grab index.php, it gives me an error. Then when I try the request with additional header information, (I'm trying this in Putty first to get the requests right), it streams a bunch of data which appears to be images.

    How can I get the html source of the main page displayed?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    alienkinetics's Avatar
    alienkinetics is offline Programmer
    Join Date
    Feb 2010
    Location
    Australia
    Posts
    154
    Rep Power
    0

    Re: Basic GET request PHP problems

    This works for me:

    Code:
    <?php
    echo "<PRE>" htmlentities(file_get_contents("http://www.slickdeals.net")) . "</PRE>";
    ?>

  4. #3
    alienkinetics's Avatar
    alienkinetics is offline Programmer
    Join Date
    Feb 2010
    Location
    Australia
    Posts
    154
    Rep Power
    0

    Re: Basic GET request PHP problems

    O, did you want PHP or Java?

    Java Tips - How to fetch an HTML page

  5. #4
    Coldblackice is offline Newbie
    Join Date
    Feb 2009
    Posts
    9
    Rep Power
    0

    Re: Basic GET request PHP problems

    Java, thanks. PHP was pretty easy

    perfect, thanks! (needed help with the redirects)

  6. #5
    alienkinetics's Avatar
    alienkinetics is offline Programmer
    Join Date
    Feb 2010
    Location
    Australia
    Posts
    154
    Rep Power
    0

    Re: Basic GET request PHP problems

    Ha, I thought it might have been a redirect issue, but I was too tired to check the site. (Normally I use Indy to sus out what a site is doing)

    Lucky I posted a link to code that supported redirection. hehe

    Buzz PHP Class Library - Web Components Made Easy!
    http://www.buzzphp.com/

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Basic Irrlicht Problems
    By Hunter100 in forum C and C++
    Replies: 7
    Last Post: 05-30-2011, 01:05 PM
  2. Visual Basic Assighment Help. (Translating pseudocode to visual basic)
    By Adolf B in forum Visual Basic Programming
    Replies: 1
    Last Post: 03-18-2011, 09:16 PM
  3. Problems with data bound grid (DBGrid32.ocx) in Visual Basic 6.0
    By jvdpeet in forum Visual Basic Programming
    Replies: 0
    Last Post: 08-12-2010, 08:21 AM
  4. Visual Basic 2008 vs. Visual Basic 2005 - Compatibility
    By cande_300 in forum Visual Basic Programming
    Replies: 1
    Last Post: 01-23-2010, 09:00 AM
  5. Basic JFrame with a basic JButton.
    By Paradox in forum Java Tutorials
    Replies: 0
    Last Post: 07-18-2008, 08:46 AM

Tags for this Thread

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