Solved

Auto Login

Posted on 2008-06-16
4
971 Views
Last Modified: 2013-11-18
PHP cide is shown below:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.earnbyads.co.in/login.aspx');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "Login1$txtUserName=user&Login1$txtPassword=userj&Login1$ddlTypeOfUser=WebUser&__VIEWSTATE=/wEPDwUKMTA0MTQ4OTU0Mg9kFgICAQ9kFgJmD2QWBAIDDw8WAh4EVGV4dGVkZAINDw9kFgIeB29uY2xpY2sFEnJldHVybiBWYWxpZGF0ZSgpO2RkVud2yrSAmKdGEaCh/XGSWjDscZ0=");
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
//# Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
//# not to print out the results of its query.
//# Instead, it will return the results as a string return value
//# from curl_exec() instead of the usual true/false.
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$store = curl_exec ($ch);
echo $store;
curl_close ($ch);
?>

This was written to autologin at the site. But it is not working . What could be the reason?
0
Comment
Question by:soorajb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:mattskelton
ID: 21796023
Hi soorajb,

First off, looks like the site is written using .net (aspx) or are you using a URL Rewrite tool? If so, could you please provide some more info. What exactly do you mean "autologin at the site"? Do you want the username/password box to be filled in when you browse to that page. If so, look into cookies that store a user name (& possibly an encrypted password although that is not recommended).

Matt
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 21796778
Try removing viewstate.

0
 
LVL 1

Author Comment

by:soorajb
ID: 22139191
Sorry for my late reply.
Well i need to login to that site. i mean my php script should login to that site and check for its default page. the default page has some info which needs to be extracted!

can u say anything for that?
0
 
LVL 1

Accepted Solution

by:
soorajb earned 0 total points
ID: 22139203
removing viewstae does not work!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question