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
what kind of response is this?
Moderator: General Moderators
what kind of response is this?
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.
EDIT: To be more specific, what kind of response is this:
?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.
Here's my full on script metropolis:
http.php
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);In the HttpRequest function definition I take the $address parameter and break it up into url parts with the parse_url function. I also break the $data parameter into parts and format it in a http request data string(this I know works).
Maybe the problem is in the $address parameter handling???
Thank you so much for the post. You don't know how much I appreciate them.
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.
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.
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.