943,661 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 770
  • PHP RSS
Jun 28th, 2009
0

Query from a website with user name and password help

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Dio1080 is offline Offline
47 posts
since Aug 2007
Jun 28th, 2009
1

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

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:
php Syntax (Toggle Plain Text)
  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.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Jun 28th, 2009
0

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

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kaleshwar is offline Offline
8 posts
since Jun 2008
Jun 28th, 2009
0

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

Thanks guys, one more question, does anybody know the Visual Basic Script version of what he typed up above?
Reputation Points: 10
Solved Threads: 0
Light Poster
Dio1080 is offline Offline
47 posts
since Aug 2007
Jun 28th, 2009
0

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

Click to Expand / Collapse  Quote originally posted by Dio1080 ...
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.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Jun 28th, 2009
0

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

Click to Expand / Collapse  Quote originally posted by cwarn23 ...
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?
Reputation Points: 10
Solved Threads: 0
Light Poster
Dio1080 is offline Offline
47 posts
since Aug 2007
Jun 29th, 2009
0

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

Would the example here be of any use to you?
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: SESSION LIFE( TIME) problem
Next Thread in PHP Forum Timeline: Plz check this path?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC