Jump to content

HTTP Post Request Screwing Up


Logicalgamers

Recommended Posts

I have two variables. $URL and $StrPost. I was to send a POST HTTPRequest to $URL with post data set at $StrPost. The catch is though, the post data is very long. Two variables are below.

 

$URL="http://tektek.org/gaia/worth.php";

$strPost='environment=0&txt=xtitle%3D%22%22+width%3D%22474%22+height%3D%224%22+%2F%3E%3C%2Ftd%3E%0D%0A%09%09%09%09+++++++++++++xtitle%3D%22Stethoscope%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Happy+Ghost+Sheet%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Polo%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Khaki+Shorts%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Sandals%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Table%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Bed%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Chair%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Plant%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Light%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Rug%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Door%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Window%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Fridge%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Punk+Starter+Top%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Baggy+Starter+Shirt%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Sporty+Starter+Shirt%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Dress+Starter+Shirt%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Punk+Starter+Pants%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Baggy+Starter+Pants%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Sporty+Starter+Shorts%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Dress+Starter+Slacks%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Boots%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Hip+Starter+Sneakers%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Dress+Starter+Shoes%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Sporty+Starter+Sneakers%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Basic+Fishing+Rod%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Morganas+Gloves%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Green+Flame+Shirt%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Ticket%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%&=Calculate+Your+Worth';

 

Now, I know for a fact that the post data works. I used the exact same post data and URL in Visual Basic and I achieved the correct return; however, there is nothing I can do in PHP to get the right return... I keep getting errors.

 

Would pay for a solution :P Whoever manages to fix first (or write a short script for me  ::)) I'll send $30 or so through Paypal.

 

Cheers.

Link to comment
https://forums.phpfreaks.com/topic/102906-http-post-request-screwing-up/
Share on other sites

As soon as the post data exceeds 1024 characters it throws out an error. Does anybody know why that is?

 

 

This is my code:

 

<?php

$URL="http://www.tektek.org/gaia/worth.php";

$strPost='environment=0&txt=xtitle%3D%22%22+width%3D%22474%22+height%3D%224%22+%2F%3E%3C%2Ftd%3E%0D%0A%09%09%09%09+++++++++++++xtitle%3D%22Stethoscope%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Happy+Ghost+Sheet%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Polo%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Khaki+Shorts%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Sandals%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Table%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Bed%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Chair%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Plant%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Light%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Rug%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Door%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Window%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Fridge%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Punk+Starter+Top%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Baggy+Starter+Shirt%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Sporty+Starter+Shirt%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Dress+Starter+Shirt%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Punk+Starter+Pants%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Baggy+Starter+Pants%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Sporty+Starter+Shorts%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Dress+Starter+Slacks%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Starter+Boots%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Hip+Starter+Sneakers%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Dress+Starter+Shoes%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Neutral+Sporty+Starter+Sneakers%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Basic+Fishing+Rod%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Morganas+Gloves%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Green+Flame+Shirt%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%22Ticket%22%3E%3Cimg+style%3D%22cursor%3A+hand%22+alt%3D%22xtitle%3D%&=Calculate+Your+Worth';

$strPost=htmlspecialchars($strPost);

$strHTML = HTTP_POST($URL,$strPost,$URL);

die($strHTML);

function HTTP_Post($url,$post,$ref) {
global $CookieName;

$aheader = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";  

$ch = curl_init($url); 
curl_setopt($ch, CURLOPT_REFERER, $ref);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.