Jump to content

Mirror a website?


christo16

Recommended Posts

Hello,

I use a website at work that you can only get into once you have logged in, is it possible to make a mirror of that site?  I would not need the entire site, just the main page.  The website is quene management type of system so I would only need the main page that shows the quene.  I do not have access to the database or any of the backend.

 

Thank you!

-Chris

Link to comment
https://forums.phpfreaks.com/topic/43790-mirror-a-website/
Share on other sites

What you want to do is to login into a site a return the html received? It's best to use the cURL library in that case.

The way to do that really depends on what the form looks like (if you could paste the login form it would be good).

Here's an example of a login with curl:

 

<?php

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "tmp/cookie.txt");
curl_setopt($ch, CURLOPT_URL, "http://www.domain.com/login.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "submit=TRUE&username=Orio&password=pass");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); 
$html = curl_exec($ch);
curl_close ($ch);
unset($ch);

//Now $html holds the html of the page gotten after logging in

?>

 

 

Orio.

Link to comment
https://forums.phpfreaks.com/topic/43790-mirror-a-website/#findComment-212765
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.