Login   Register  
PHP Classes
elePHPant
Icontem

File: saveCompletePage.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sarfraz Ahmed  >  PHP Save Complete HTML Page  >  saveCompletePage.php  >  Download  
File: saveCompletePage.php
Role: Example script
Content type: text/plain
Description: saveCompletePage.php
Class: PHP Save Complete HTML Page
Save HTML pages complete with images, CSS and JS
Author: By
Last change:
Date: 10 months ago
Size: 823 bytes
 

Contents

Class file image Download
<?php

if (isset($_POST['submit'])) {
    
$url $_POST['url'];
    
    if (! 
trim($url)) {
        
header('LOCATION: index.php?e=' urlencode('No URL Specified'));
        exit;
    }
    
    
$contentonly = isset($_POST['content']) ? true false;
    
$keepjs = isset($_POST['javascript']) ? true false;
    
$compress = isset($_POST['compress']) ? true false;

    
# include the class
    
require_once 'includes/htmlSaveComplete.php';
    
$htmlSaveComplete = new htmlSaveComplete($url);
    
$html $htmlSaveComplete->getCompletePage($keepjs$contentonly$compress);
    
    if (! 
$html) {
        
header('LOCATION: index.php?e=' urlencode('Error saving the page, please try again later.'));
        exit;    
    }
    
    
file_put_contents('output.html'$html);
    
header('LOCATION: index.php?s=1');
    exit;    
}
else {
    
header('LOCATION: index.php');
}