Query from a website with user name and password help

Reply

Join Date: Aug 2007
Posts: 47
Reputation: Dio1080 is an unknown quantity at this point 
Solved Threads: 0
Dio1080's Avatar
Dio1080 Dio1080 is offline Offline
Light Poster

Query from a website with user name and password help

 
0
  #1
Jun 28th, 2009
Hello everybody. My question is does anybody know any script commands that will allow me retrieve information from an website that has a user name and password? For example, I write a script that ask the user to enter in a user name and password, then the script goes to the website to query some information and the user doesn't need to go to the website himself to enter in the user name and password.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,518
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 136
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Posting Virtuoso

Re: Query from a website with user name and password help

 
1
  #2
Jun 28th, 2009
Well if that website that php re-enters the password in uses $_GET tags and not $_POST tags then you can simply use the file_get_contents() function to retieve the information. If however the external website uses $_POST tags then you will need to use curl.
So the basic usage of file_get_contents for communicating with an external website is as follows:
  1. <?
  2. $page=file_get_contents('http://www.example.com/page?user=cwarn23&pass=820578wxz56240358');
  3. ?>
Btw, that's a fake password. Hope the above example helps.
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*`
My favourite PC. - MacGyver Fan
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 8
Reputation: kaleshwar is an unknown quantity at this point 
Solved Threads: 0
kaleshwar kaleshwar is offline Offline
Newbie Poster

Re: Query from a website with user name and password help

 
0
  #3
Jun 28th, 2009
Look into curl, as it will let you do just what you want with any types of authentications, i.e. Get, Post or the .htaccess one
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 47
Reputation: Dio1080 is an unknown quantity at this point 
Solved Threads: 0
Dio1080's Avatar
Dio1080 Dio1080 is offline Offline
Light Poster

Re: Query from a website with user name and password help

 
0
  #4
Jun 28th, 2009
Thanks guys, one more question, does anybody know the Visual Basic Script version of what he typed up above?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,518
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 136
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Posting Virtuoso

Re: Query from a website with user name and password help

 
0
  #5
Jun 28th, 2009
Originally Posted by Dio1080 View Post
Thanks guys, one more question, does anybody know the Visual Basic Script version of what he typed up above?
Who typed what above? If your refering the the script I posted earlier that is a php script which just retrieves the file/url contents.
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*`
My favourite PC. - MacGyver Fan
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 47
Reputation: Dio1080 is an unknown quantity at this point 
Solved Threads: 0
Dio1080's Avatar
Dio1080 Dio1080 is offline Offline
Light Poster

Re: Query from a website with user name and password help

 
0
  #6
Jun 28th, 2009
Originally Posted by cwarn23 View Post
Who typed what above? If your refering the the script I posted earlier that is a php script which just retrieves the file/url contents.
Yes, I was just wanting to know if you knew how to convert the php script you just wrote into visual basic script?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,518
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 136
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Posting Virtuoso

Re: Query from a website with user name and password help

 
0
  #7
Jun 29th, 2009
Would the example here be of any use to you?
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*`
My favourite PC. - MacGyver Fan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC