Solved

Auto Login

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Form submit issue 11 52
Creating a slider 12 33
Problem to page 4 17
sql sentence 2 10
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

708 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

16 Experts available now in Live!

Get 1:1 Help Now