473,320 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PHP - Verify username and password of remote website

I am not a programmer, i want to check the username and password of remote website using php curl script. I have to code but it doesnt work. Can any one make changes to this script and make it workable?

Here is the script
Expand|Select|Wrap|Line Numbers
  1.  
  2. $username="yumiyao0926"; 
  3. $password="yumiyao0926"; 
  4. $url="http://www.hotfile.com/login.php"; 
  5. $cookie="cookie.txt"; 
  6.  
  7. $postdata = "email=".$username."&password=".$password; 
  8.  
  9. $ch = curl_init(); 
  10. curl_setopt ($ch, CURLOPT_URL, $url); 
  11. curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
  12. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); 
  13. curl_setopt ($ch, CURLOPT_TIMEOUT, 60); 
  14. curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0); 
  15. curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
  16. curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); 
  17. curl_setopt ($ch, CURLOPT_REFERER, $url); 
  18.  
  19. curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata); 
  20. curl_setopt ($ch, CURLOPT_POST, 1); 
  21. $result = curl_exec ($ch); 
  22.  
  23. echo $result;  
  24. curl_close($ch);
  25.  
  26.  
  27.  
Username and password enter in the script works. I just want the script to return successful or unsuccessful result.
Mar 8 '12 #1
1 1582
PsychoCoder
465 Expert Mod 256MB
Well for starters where did you get this code. Since you said you're not a programmer it tells me you picked this code from a site. What's the code doing versus what you need it to do?
Mar 10 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: deko | last post by:
I want to use htaccess for authentication on my php site since I only have a few users who need access to secure areas. So, I created a new directory off public_html (secretDocs) and in that...
4
by: Lobang Trader | last post by:
Hi all, I am trying to create a username and a password class. I would like to know what are the RECOMMENDED minimum and maximum length for both fields? These fields will be something like...
2
by: john brown | last post by:
There is a web page that I access frequently and would like to automate the authentication of the username and password. I would like to user a perl script but I'm not really sure about the steps....
8
by: Noel Volin | last post by:
Anyone who can help here is much appreciated. I am trying to programmatically log onto a website. I am using the code provided in VS for the AuthenticationManager Class example (...
2
by: Jéjé | last post by:
Hi, I have a web site where I display a webpage from another website in an IFrame. the 2 servers are on the local intranet and I'm using basic authentication. The problem, when the IFrame...
1
by: thoducng | last post by:
I am writing some code to access share folder on a remote network. DirectoryInfo dicInfo = new DirectoryInfo("remoteNetwork\shareFolder"); if (dicInfo.Exists) { //application code...
12
by: Cecil | last post by:
Does this make sense for a logon table: CREATE TABLE Logon ( ID INT NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(15) NOT NULL, password VARCHAR(15) NOT NULL ) GO CREATE UNIQUE INDEX...
2
by: VMI | last post by:
How can I add username/password authentication on my site? I have asp.net 2.0. If the user's not logged in, that page should be displayed when I try to go to any of the pages. Also, how can I add...
5
by: livefreeordie | last post by:
Hi, I'm part of a 5-person team that develops websites for our company. I need to use the ftp_* functions to find some files on another file server. I need to authenticate to the file server...
30
by: diane | last post by:
I've got an application running with table-based security: i capture the user's windows login with fOsusername, then have them enter a password checked against their username/login in my own table....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.