PHP Classes

File: example0.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Horst Nogajski  >  HN URL Rewrite  >  example0.php  >  Download  
File: example0.php
Role: Example script
Content type: text/plain
Description: example
Class: HN URL Rewrite
Emulate request URL rewriting and redirection
Author: By
Last change: (see comment of classfile)
Date: 10 years ago
Size: 2,074 bytes


Class file image Download

// HN_URL_rewrite :: example 0

$root = (strrpos($_SERVER['DOCUMENT_ROOT'],'/')==strlen($_SERVER['DOCUMENT_ROOT'])-1) ? substr($_SERVER['DOCUMENT_ROOT'], 0, strlen($_SERVER['DOCUMENT_ROOT'])-1) : $_SERVER['DOCUMENT_ROOT'];

// Build class instance
$rewrite =& new hn_urlrewrite();

// start buffer
$rewrite->buffer_start(); // optionally it can send headers against caching by passing a TRUE to the method

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Description" CONTENT="Beschreibung soll max 150 Zeichen sein">
<META NAME="Keywords" CONTENT="Schlagworte, sollen insgesamt max. 874 Zeichen lang sein, und, Kommasepariert, wie, hier,">

<h1>PHP-Class hn_urlrewrite :: EXAMPLE 0</h1>
<h3>no specific scripts are registered</h3>
<h3>this example uses the buffer methods<br>and also gzip compression, if your browser support this</h3>
<p><a href="/hn_urlrewrite_example/example1.php?param1=value1&param2=value2&param3=value3" title="test">example1.php?param1=value1&param2=value2&param3=value3</a></p>
<p><a href="/hn_urlrewrite_example/example2.php?param1=value1&param2=value2&param3=value3">example2.php?param1=value1&param2=value2&param3=value3</a></p>
<p><a href="/hn_urlrewrite_example/sub1/example3.php?name=JohnDoe&">example3.php?name=JohnDoe&</a></p>

// stop buffering and rewrite pagecontent
$rewrite->buffer_end(); // optionally it can rewrite img-tags too, when passing TRUE to the method!

    // output rewritten page
$rewrite->send_page(TRUE); // optionally it can compress content if browser supports this

    // or: $string = $rewrite->page; //if you don't want direct output