Solved

Auto Login

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now