Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote http call error 1

Status
Not open for further replies.

brownfox

Programmer
Jan 5, 2003
173
GB
When a purchase is made from my site I have mals-e.com send a remote http request to a page that updates the database etc. However it always fails - in debug mode I get this:
Code:
HTTP/1.1 302 Moved Temporarily
Plus some other stuff about get vars...
If I hit the page in a browser, everything works OK. If I use putty I get the same HTTP/1.1 302 Moved Temporarily error. Is this the problem I wonder? Why would the remote call fail when a browser request works...?
T.I.A
 
OK thanks but I don't see where I'm supposed to be redirected to:
Code:
Remote connect to audiochess.com/icc_callback.php returned the following:

HTTP/1.1 302 Moved Temporarily
Server: Zeus/4.3
Date: Thu, 23 Mar 2006 02:57:06 GMT
Location: [URL unfurl="true"]http://www.audiochess.com/icc_callback.php?username=******&id=******&ip=**[/URL]
*
***.**.**&date=22+Mar+2006+-+21%3A01&method=Worldpay&cart=ICC+Entry+Fee+-
+Auth+Code%3A07-87-04-62+%3A+1+%3A+1+%3A+0+%3A+&discount=0.00&subtotal=
1.00&shipping=0.00&tax=0.00&total=1.00&shipping_zone=0&shipping_calc=
&inv_name=C+Armstrong&inv_company=&inv_addr1=Flat+1+77a+London+Road&
inv_addr2=Epsom&inv_state=Surrey&inv_zip=KT172BL&inv_country=GB&del_name=
&del_company=&del_addr1=&del_addr2=&del_state=&del_zip=&
del_country=&del_tel=&tel=&fax=&email=****.*******%40ntlworld.com&currency
=0&extra=&vval=0.00&voucher=&edata=&message=&inv_id=
Transfer-Encoding: chunked
Plus the fact that the page exists so why the 302 error?
 
Unfortuntately, I do not know the exact URL to which your script is trying to originally go. All I know is that according to the HTTP 1.1 spec, when a web server returns a status value of 302, it will return a Location: header, and all web browsers are supposed to automatically go to the location specified in the "Location:" header.

The "Location:" header you posted directs the browser to "
Is that exactly the URL to which your script originally tried to go?



Want the best answers? Ask the best questions! TANSTAAFL!
 
Well sort of. The callback is configured to go to:
http:/AND append data (as $_GET data) to the URL which is then supposed to be able to be parsed and inserted into database to confirm purchase or whatever.
That's what is supposed to occur, but, as you say I'm being redirected!
 
Chances are, the redirction happens every time you go to this site. It's just that your browser automagically does it and you never see it.

Have you tried following the redirection?



Want the best answers? Ask the best questions! TANSTAAFL!
 
Yes, with a browser and my script works fine. But this needs to be done automatically hence the remote http call. I've done thing like:
Code:
print($_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']."<br>");
To determine the page's real URL but from a browser this obviously doesn't help. Why am I being redirected from this page/site anyway, what's going on? some sort of proxy re-route from the server (i don't know too much about this - virtual server/URL?)
 
Insufficient data for a meaningful answer.

I do not know what the icc_callback.php script does. I do not know what the script's source looks like. I do not have access o the configuration of the web server on which that script resides. I therefore cannot give an informed opinion of what is going on.

The status is 302. There is a "Location:" header. Under these circumstances, the spec says follow the "Location:" header.




Want the best answers? Ask the best questions! TANSTAAFL!
 
The script at does this:
Code:
$recipient ="webmaster@audiochess.com";
$subject = "new data1";
$from = "webmaster@audiochess.com";
$message="test";
$additional="test";
$sender = "webdesigner@audiochess.com";
$mailResult = mail (
                   $recipient,
                   $subject,
                   $message,
                   "From: $sender\r\n$additional"
           );
As for the server config. I don't know either
- easyspace : (
 
ok sorry:
Code:
<?
$recipient ="webmaster@audiochess.com";
$subject = "new data1";
$from = "webmaster@audiochess.com";
$message="test";
$additional="test";
$sender = "webdesigner@audiochess.com";
$mailResult = mail (
                   $recipient,
                   $subject,
                   $message,
                   "From: $sender\r\n$additional"
           );
?>
 
That's the conclusion I have come to. I have sent off a ticket to them so I'll repost if I get a satisfactory answer in case anyone else has this problem...
Thanks for your help!
 
I think I've got this. The problem is because the $_GET query string was too long. I remember we use $_POST as we can take more data. $_GET is limited to 255 chars or something - I'm giving myself a star
 
Yes but I want the callback to work first, then I will re-write script to insert data. If the process doesn't work then there's no point in writing a script. I'm DEBUGGING first to iron out the problem. The problem is that the call back fails because there is too much data in the query string. Get it?
I wrote a full script at first and it failed. So I tried to debug with simply using a mail() function too see what was going on. It didn't work. I have re-sent the url with query string (allbeit an abridged string and it works QED it must be the length of the $_GET string that is causing the problem!
(I hope)
 
brownfox:
How would anyone but you know what you have and have not tried to debug this code? How would anyone but you know what you have tried with success of failure? Particularly in light of the fact that you didn't think it necessary to share any of this with the forum.

brownfox said:
I'm giving myself a star
Of course. No one else had the full picture of what was going on.



Want the best answers? Ask the best questions! TANSTAAFL!
 
OK I was joking about the star - notice I haven't given myself one....
Debugging is something we ALL do when things don't go as we expect - yes?
I have never used a remote http call before. The problem is that this procedure requires third party code, from my payment gateway AND it seems (like a lot of things) to depend on particular server settings.
So don't be too critical on me. I'm glad I have isolated the problem that's all, and thanks sleipnir214, for if it wasn't for you I don't think I would of arrived at the conclusion that it WAS a particular server issue that was causing the 302 issue etc!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top