Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 18th, 2012  |  syntax: None  |  size: 1.78 KB  |  views: 88  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $url = "https://www.walmart.com/cservice/ProcessShoppingCard.do";
  3. //
  4. $h = curl_init();
  5.  
  6. curl_setopt($h, CURLOPT_URL, $url);
  7. curl_setopt($h, CURLOPT_SSL_VERIFYPEER, false);
  8. curl_setopt($h, CURLOPT_POST, true);
  9. curl_setopt($h, CURLOPT_POSTFIELDS, array(
  10. 'cardNumber' => '1234567890123456',
  11. 'pin' => '1234',
  12. 'GetCardBalance' => 'GetCardBalance'
  13. ));
  14. curl_setopt($h, CURLOPT_HEADER, true);
  15. curl_setopt($h, CURLOPT_RETURNTRANSFER, true);
  16.  
  17. $result = curl_exec($h);
  18. echo $result;
  19.  
  20.  
  21. ?>
  22.        
  23. <form name="CheckCardBalance" action="/cservice/ProcessShoppingCard.do" method="POST" class="CheckCardBalance">
  24.     ...
  25.     <input type="text" size="18" maxlength="16" value="" name="cardNumber">
  26.     ...
  27.     <input type="password" size="4" maxlength="4" value="" name="pin">
  28.     ...
  29. </form>
  30.        
  31. $params = array ('cardNumber' => '1234567890', 'pin' => '1234');
  32. $query = http_build_query ($params);
  33.  
  34. $contextData = array (
  35.                    'method' => 'POST',
  36.                    'header' => "Connection: closern".
  37.                                "Content-Length: ".strlen($query)."rn",
  38.                    'content'=> $query
  39.                );
  40.  
  41. $context = stream_context_create (array('http' => $contextData));
  42.  
  43. $result = file_get_contents(
  44.               'https://www.walmart.com/cservice/ProcessShoppingCard.do',
  45.               false,
  46.               $context
  47.           );
  48.        
  49. $url = "https://www.walmart.com/cservice/ProcessShoppingCard.do";
  50. //
  51. $h = curl_init();
  52. curl_setopt($h, CURLOPT_URL, $url);
  53. curl_setopt($h, CURLOPT_SSL_VERIFYPEER, false);
  54. curl_setopt($h, CURLOPT_POST, true);
  55. curl_setopt($h, CURLOPT_POSTFIELDS, "cardNumber=1234567890123456&pin=1234&GetCardBalance.x=90&GetCardBalance.y=8");
  56. curl_setopt($h, CURLOPT_HEADER, true);
  57. curl_setopt($h, CURLOPT_RETURNTRANSFER, true);
  58. //
  59. $result = curl_exec($h);
  60. echo $result;
clone this paste RAW Paste Data