473,379 Members | 1,222 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,379 software developers and data experts.

Copy webpage, protected by session

Hi,

I want to copy a page from the internet with fopen and fread. Now the
problem is that you have to be logged in with a sessin to get to that
page. Now I tried a couple of things. I tried to simulate the output of
the login form in a link and open it with fopen and fread, to make the
website see php as a logged in user, and then let the same script php
copy the page I want. This did not work. Than I tried to open the page
with netscape, logged in, and copy all the vars the website had stored
in cookies and make a link out of that and use it in Internet Explorer
to test if it would work. It didn't work. Turning of cookies in IE made
it impossible to log in onto the website.
Is there a way too make this website accept php as a logged in user? I'm
getting out of ideas with my limited knowledge of php and sessions in
general. Maybe I did something wrong in my previous tests.. but any
thoughts?

Thanks in advance, Maarten

Jul 17 '05 #1
2 2095
Maarten Koster <ma*****@custodis.cistron.nl> wrote in message news:<cl**********@news.cistron.nl>...
Hi,

I want to copy a page from the internet with fopen and fread. Now the
problem is that you have to be logged in with a sessin to get to that
page. Now I tried a couple of things. I tried to simulate the output of
the login form in a link and open it with fopen and fread, to make the
website see php as a logged in user, and then let the same script php
copy the page I want. This did not work. Than I tried to open the page
with netscape, logged in, and copy all the vars the website had stored
in cookies and make a link out of that and use it in Internet Explorer
to test if it would work. It didn't work. Turning of cookies in IE made
it impossible to log in onto the website.
Is there a way too make this website accept php as a logged in user? I'm
getting out of ideas with my limited knowledge of php and sessions in
general. Maybe I did something wrong in my previous tests.. but any
thoughts?


1. http://in.php.net/curl
2. http://curl.haxx.se/libcurl/php/exam...=cookiejar.php
3. http://curl.haxx.se/libcurl/php/examples/

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #2
"Maarten Koster" <ma*****@custodis.cistron.nl> wrote in message
news:cl**********@news.cistron.nl...
Hi,

I want to copy a page from the internet with fopen and fread. Now the
problem is that you have to be logged in with a sessin to get to that
page. Now I tried a couple of things. I tried to simulate the output of
the login form in a link and open it with fopen and fread, to make the
website see php as a logged in user, and then let the same script php
copy the page I want. This did not work. Than I tried to open the page
with netscape, logged in, and copy all the vars the website had stored
in cookies and make a link out of that and use it in Internet Explorer
to test if it would work. It didn't work. Turning of cookies in IE made
it impossible to log in onto the website.
Is there a way too make this website accept php as a logged in user? I'm
getting out of ideas with my limited knowledge of php and sessions in
general. Maybe I did something wrong in my previous tests.. but any
thoughts?

Thanks in advance, Maarten


Use stream_get_meta_data() to get the cookie from the HTTP response, then
use stream_context_create() for adding the cookie into a HTTP request and
for making a POST.
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Pete..... | last post by:
Hi all I am working on a log in script for my webpage. I have the username and the password stored in a PostgreSQL database. The first I do is I make a html form, where the user can type in his...
42
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same...
23
by: Luc | last post by:
how can I copy protect the text content of my webpage?
2
by: swbaz | last post by:
What is an effect way to prevent users from viewing a webpage directly by typing in its URL? For example: If a default page is set up as a login screen with user name and password. The user...
1
by: Joseph Morales | last post by:
I'm trying to code a free-standing VBScript, executed by Windows Script Host on a client system, to push a button on an ASP .NET webpage that is hosted by another server. Note that the script is...
3
by: Jul | last post by:
Hi, I need to create copy (clone) the OracleConnection object. The OracleConnection class does not contain "Clone" method for creating copy. It contains Protected MemberwiseClone but if use...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.