what kind of response is this?
Posted: Fri Aug 24, 2007 12:31 pm
What kind of HTTP response is this? I googled it, and I don't understand what it means? I sent a request using the POST method.HTTP/1.0 302 Moved Temporarily Location
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
What kind of HTTP response is this? I googled it, and I don't understand what it means? I sent a request using the POST method.HTTP/1.0 302 Moved Temporarily Location
I'm sorry for being dubious, but I'm not understanding to my fullest extent. Please explain why it's straight forward, and more importantly: what it's straight forward to.Oren wrote:Hmm... It's pretty much straight forward, isn't it?
Because it says: "Moved Temporarily Location"JellyFish wrote:Please explain why it's straight forward, and more importantly: what it's straight forward to.
What's "Moved Temporarily"? The file I made request to? If so, why would that file have moved? Or does this mean that the page that I made the request to has redirected to another page?Oren wrote:Because it says: "Moved Temporarily Location"JellyFish wrote:Please explain why it's straight forward, and more importantly: what it's straight forward to.
?HTTP/1.0 302 Moved Temporarily Location: https://www.linkpointcentral.com/lpc/servlet/lppay X-Cache: MISS from wc04.inet.mesa1.secureserver.net Connection: close 168
Okay, why wouldn't it be there?pickle wrote:Basically 302 is similar to 404 in that the file you requested isn't there. 302 means that the file has been moved temporarily.
Code: Select all
<?php
function HttpRequest($address, $data)
{
$url = parse_url($address);
while (list($key, $value) = each($data))
{
$dataToPost .= "$key=$value&";
}
$dataToPost = rtrim($dataToPost, "&");
$request = "POST ".$url['path']." HTTP/1.1\r\n"
. "Host: ".$url['host']."\r\n"
. "Content-Type: application/x-www-form-urlencoded;\r\n"
. "Content-Length: ".strlen($dataToPost)."\r\n"
. "\r\n"
. $dataToPost;
$socket = @fsockopen($url['host'], 80, $errno, $errstr) or die("Error: unable to open a socket connection with ".$url['host']."\n $errno: $errstr");
fwrite($socket, $request);
// Response
$response = '';
while (!feof($socket)) {
$response .= fpassthru($socket);
}
fclose($socket);
return $response;
}
?>Code: Select all
$myorder["host"] = "secure.linkpt.net";
$myorder["port"] = "1129";
$myorder["keyfile"] = "/home/content/******html/lpAPI/cert.pem"; # Change this to the name and location of your certificate file
$myorder["storename"] = "1085600"; # Change this to your store number
$myorder["txntype"] = "SALE";
$myorder["chargetotal"] = "2.95";
$myorder["cardnumber"] = $_POST['ccard_num'];
$myorder["expmonth"] = $_POST['ccard_exp_month'];
$myorder["expyear"] = $_POST['ccard_exp_year'];
$myorder["cvm"] = $_POST['CID']; # Required for AVS. If not provided, transactions will downgrade.
$myorder["zip"] = $_POST['zip']; # Required for AVS. If not provided, transactions will downgrade.
$myorder["debugging"] = "true"; # for development only - not intended for production use
# periodic fields
/* $myorder["action"] = "SUBMIT";
$myorder["installments"] = "1";
$myorder["threshold"] = "3";
$myorder["startdate"] = "immediate";
$myorder["periodicity"] = "monthly"; */
# Send transaction. Use one of two possible methods #
$transaction = HttpRequest("https://www.linkpointcentral.com/lpc/servlet/lppay", $myorder); //$lpObj->curl_process($myorder) or die("Fialed at sending the transaction using curl_process method!"); # use curl methods
exit($transaction);So 302 code means that the page that I sent the request to has redirected to another page? If that's the case then why wasn't the response the contents of the page it redirected to?Citizen wrote:JellyFish,
A 302 usually means that someone places a bit of code (either in php or on the .htaccess file, etc) that is redirect you another page or report an error. Webmasters use this to direct users and search engines to the correct page.
For instance, if I temporarily renamed a file, i'd use a 302 to not waste any incoming links for SEO purposes.
It started out as three different questions. Sorry, I didn't have my head on straight.feyd wrote:Why do you have three threads for the same piece of code?