-
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.
-
-
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.)
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks