PHP Classes

File: saveCompletePage.php

Recommend this page to a friend!
  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: 8 years ago
Size: 823 bytes


Class file image Download

if (isset($_POST['submit'])) {
$url = $_POST['url'];
    if (!
trim($url)) {
header('LOCATION: index.php?e=' . urlencode('No URL Specified'));
$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.'));
file_put_contents('output.html', $html);
header('LOCATION: index.php?s=1');
else {
header('LOCATION: index.php');

For more information send a message to info at phpclasses dot org.