Solved

Auto Login

Posted on 2008-06-16
4
970 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
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

820 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