Results 1 to 2 of 2

Thread: http request problem

  1. #1
    Join Date
    Feb 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default http request problem

    I have to pass a post variable to one page and get back the value though http request.
    I tried to make request to some page like yahoo.com. It's success for me to use the fsockopen function.

    example:
    $URL = "http://www.yahoo.com";
    $URL_Info=parse_url($URL);
    $fp = fsockopen($URL_Info["host"],80,$errno,$errstr,10);

    it's success for yahoo.com

    However, it failed to make connection to one .jsp page which is:

    Fail example:
    $failURL = "http://www.xxxxx.com/jsp/yyyy.jsp";
    $URL_Info=parse_url($failURL );
    $fp = fsockopen($URL_Info["host"],80,$errno,$errstr,10);

    it failed.
    besides, it works when I submit the form directly to this page(NOT the http request).

    What 's the possible problem on it? How can I debug?@@

    And also, I found it failed to access the root of $failURL, which is 'www.xxxxx.com' . Is it the problem on this situation?

    Thanks.

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    How does the POST variable come into all this? As far as I can see, fsockopen doesn't pass POST data...

    When the connection to the JSP page failed, did you get any errors? (Use error_reporting(E_ALL | E_STRICT); at the top of your script to see all errors, warnings, etc.)

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
  •