Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 3rd, 2008, 1:20 PM   #1
drumltd
Newbie
 
Join Date: Aug 2005
Posts: 19
Rep Power: 0 drumltd is on a distinguished road
Open Password protected web pages.

I need to open and read a web page in PHP (I can do that bit already)

The problem is to open the page you need to fill in the login page, which in turn creates a cookie, which is then passed when open the second page.

At the moment I'm looking at the cookies in firefox, and putting these values into my code to get the system to work, however this isn't really a long term solution, as the cookies only last a couple of hours.

Anybody any ideas how I can do this. (I do have a legitimate username and password for the site)
drumltd is offline   Reply With Quote
Old Apr 3rd, 2008, 8:44 PM   #2
Jimbo
Expert Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 705
Rep Power: 3 Jimbo is on a distinguished road
Re: Open Password protected web pages.

You can set the cookies to last longer. setcookie() documentation

[edit:] sorry, misunderstood your problem
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>

Last edited by Jimbo; Apr 3rd, 2008 at 9:13 PM.
Jimbo is offline   Reply With Quote
Old Apr 3rd, 2008, 8:48 PM   #3
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,722
Rep Power: 5 Sane is on a distinguished road
Re: Open Password protected web pages.

Try looking into CURL. It is a library for PHP that allows you to communicate with other servers across the HTTP protocol. Without looking at the docs, I am guessing that it will have support for logging in and cookie manipulation.
Sane is offline   Reply With Quote
Old Apr 12th, 2008, 3:00 AM   #4
drumltd
Newbie
 
Join Date: Aug 2005
Posts: 19
Rep Power: 0 drumltd is on a distinguished road
Re: Open Password protected web pages.

From what I figure out, the first page uses a post to login and generate the cookie, the secondpage is the data I want.

I'm struggling getting my head round some of the Curl stuff, can anybody point me to any examples that open an ASP Session using this method?
drumltd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can't open php pages BlackSmith PHP 7 Aug 22nd, 2006 4:07 PM
[Python] Password Generator bulio Show Off Your Open Source Projects 2 Feb 28th, 2006 3:01 AM
password box ragenuub Visual Basic 5 Nov 15th, 2005 3:46 PM
Just a small password generator Jessehk Show Off Your Open Source Projects 3 Sep 16th, 2005 8:41 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:52 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC