0

hi there i am trying to creat a php script to login to my tesco account but for some reason the cookies are not working please help here is my script below and also an example of my script below so u can check it out .

Check it out it does not work

<?php
$url = "https://secure.tesco.com/register/default.aspx?vstore=0";
//
$h = curl_init();
curl_setopt($h, CURLOPT_URL, $url); 
curl_setopt($h, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($h, CURLOPT_POST, true);
curl_setopt($h, CURLOPT_POSTFIELDS, "form=fSignin&from=https%3A%2F%2Fsecure.tesco.com%2Fclubcard%2Fmyaccount%2Fhome.aspx&formData=bmV3UmVnPWZhbHNlJg%3D%3D&loginID=test%40hotmail.com&password=test&seamlesswebtag=&confirm-signin.x=47&confirm-signin.y=18");
curl_setopt($h, CURLOPT_HEADER, true);
curl_setopt($h, CURLOPT_RETURNTRANSFER, true);
curl_setopt($h, CURLOPT_COOKIE, 'tmpfile.tmp');
curl_setopt($h, CURLOPT_COOKIEJAR, 'tmpfile.tmp');
curl_setopt($h, CURLOPT_COOKIEFILE, 'tmpfile.tmp');
//
$result = curl_exec($h);
echo $result;
?>

can someplease help me fix this so it gets and uses the cookies properly

1 Answer 1

1

You don't need this line

curl_setopt($h, CURLOPT_COOKIE, 'tmpfile.tmp');

try removing it, if still has a problem, try to create tmpfile.tmp and set chmod to 777.

Sign up to request clarification or add additional context in comments.

2 Comments

i have got that to work now i have another error visit my website it says object moved here i click the here but nothing
Maybe you should set CURLOPT_FOLLOWLOCATION, read more about it here php.net/manual/en/function.curl-setopt.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.