Amazon remote log-in (PHP cURL) | Cookies -


i'm trying make remote log-in amazon. basically, user log-in through our local form. , if filled in correct, logged in @ amazon. `

            if(isset($_post['submit']))                  {                        $account = $_post["account"];                     $pass = $_post["pass"];                        $ch = curl_init("https://www.amazon.com/ap/signin?_encoding=utf8&openid.assoc_handle=usflex&openid.claimed_id=http%3a%2f%2fspecs.openid.net%2fauth%2f2.0%2fidentifier_select&openid.identity=http%3a%2f%2fspecs.openid.net%2fauth%2f2.0%2fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3a%2f%2fspecs.openid.net%2fauth%2f2.0&openid.ns.pape=http%3a%2f%2fspecs.openid.net%2fextensions%2fpape%2f1.0&openid.pape.max_auth_age=0&openid.return_to=https%3a%2f%2fwww.amazon.com%2fgp%2fyourstore%2fhome%3fie%3dutf8%26ref_%3dnav_ya_signin");                         curl_setopt($ch, curlopt_post, true);                        curl_setopt($ch, curlopt_ssl_verifypeer, false);                     curl_setopt($ch, curlopt_cookiesession, true );                      curl_setopt($ch, curlopt_postfields, "ap_email=" .$account."&ap_password=".$pass."");                         curl_exec($ch);                         if (curl_errno($ch))                           {                                 print curl_error($ch);                           }                      else                          {                              curl_close($ch);                            }                   }              else                  {              ?>      <form method="post" action="<?php echo $_server['php_self'];  ?>" name="login">          <table width="100%">              <tr align="center">                  <td width="50%" align="right"><font color="navy">e-mail</font></td>                  <td width="50%" align="left"><input type="text" name="account" size="10"></td>              </tr>               <tr align="center">                  <td width="50%" align="right" width="100"><font color="navy">password</font></td>                  <td width="50%" align="left"><input type="password" size="10" name="pass"></td>              </tr>              <tr>                  <td>&nbsp;</td>              </tr>              <tr align="center">                  <td colspan="2" align="center"><input name="submit" type="submit" value="inloggen"></td>              </tr>           </table>          </form>          <?php } ?>` 

this code i've used. , i'm getting following error:

please enable cookies continue

to continue shopping @ amazon.com, please enable cookies in web browser. learn more cookies , how enable them.

once have enabled cookies in browser, please click on button below return previous page.

how can fix error? i've tried everything.

i'm using xampp @ moment.

just marking answer:

you have 2 things:

1 - request login page server using method

2 - send login data using new session , hidden inputs

to see script : https://stackoverflow.com/a/7532730/889678


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -