Jump to content

curiousmike

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

curiousmike's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've done some quick reading on curl redirects, and tried a few examples posted by users in the official PHP docs. None have worked. I've gotten further, with a valid response... but the valid response is the age-verification page again. I'm unsure that me POSTing the values is "sticking." $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, 'http://store.steampowered.com/agecheck/app/1250/'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt($ch,CURLOPT_POSTFIELDS,'ageDay=1&ageMonth=1&ageYear=1992'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $myPage = curl_exec($ch); if ($myPage) { echo ('success<br>'); // This is happening, and echoing "myPage" results in the age-restricted page coming up echo ($myPage); } else echo ('fail<br>');
  2. Thanks for the suggestion; the curl_exec is giving me an error. It appears the return code is 302 ([http_code] => 302), which Wikipedia tells me is a redirect. I'm completely lost at this point; is curl telling me it succeeded, but fails because of the redirect(?) Isn't the re-direct what I want? <?php $ch = curl_init(); if ($ch) { $bOK = false; $bOK = curl_setopt($ch,CURLOPT_URL, 'http://store.steampowered.com/agecheck/app/1250/'); //$bOK = curl_setopt($ch,CURLOPT_URL, 'http://store.steampowered.com/app/1250/'); if (!$bOK) echo ("error 1<br>"); $bOK = curl_setopt($ch,CURLOPT_POSTFIELDS,'ageDay=1&ageMonth=1&ageYear=1992'); if (!$bOK) echo ("error 2<br>"); $bOK = curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5"); if (!$bOK) echo ("error 3<br>"); $bOK = curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); if (!$bOK) echo ("error 4<br>"); $result = curl_exec($ch); if ($result) { echo ("got something<br>"); } else { print_r(curl_getinfo($ch)); } curl_close($ch); } else { echo ('error initing curl<br>'); } ?>
  3. A couple months back, I asked on a gaming forum if anyone knew of a website that would track your *Steam Wishlist and email you when one of your wishlist games went on sale. No one at the time knew of a **solution, so I decided to buy "PHP, MySQL and Javascript" and try to roll my own. I managed to get the basics working. After the basics, I started thinking about fun stuff I could do with the data I collected from Steam regarding the games that go on sale regularly. The first part of my code file_get_content's the ***sale page(s) of games, and sucks out the games name, regular price, sale price, and the games homepage URL on Steam. This is enough to accomplish my basic task. The second part is where I need help, and that's getting more details on the game. The additional details I want to get about the game include its Publisher and Developer, and to get that detail I need to go to the games homepage URL I previously got from the global sale page. The issue is this: Some games have an age-restriction limitation, and you have to fill out a date form before entering the games homepage. An example of one of those pages would be: http://store.steampowered.com/agecheck/app/1250/ I want to be able to POST a legal age to the above URL, and then (this is where I'm hazy) "re-load" the same URL, authorized by my previous POST. Is that possible? * Steam is a digital download service for computer games. ** Subsequently, there was another website found. But I was well into developing my solution and having fun. *** Example: http://store.steampowered.com/search/?specials=1
×
×
  • 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.