PHP Classes
elePHPant
Icontem

File: inc_strato_html.txt

Recommend this page to a friend!
  Classes of Peter Klauer  >  ezhtml  >  inc_strato_html.txt  >  Download  
File: inc_strato_html.txt
Role: Documentation
Content type: text/plain
Description: How to use the ssl extension with ezhtml
Class: ezhtml
Framework to generate HTML head, body and divs
Author: By
Last change: Instead of using the meta_no_ssl() and meta_ssl() functions, the new
way is to use the header_no_ssl() and header_ssl() functions. You know that some browsers allow to disable the <meta refresh>, the header('Location:...')
cannot be disabled and is much faster, the page does not need to be completely loaded into the browser to execute the redirection.
Date: 14 years ago
Size: 2,166 bytes
 

Contents

Class file image Download
Here are some rows of code from http://www.ingoknito.de/produkte/buchstaben/index.php

The problem is that after the ordering the whole site rests in ssl mode.
There should be a easy way to go back to normal, fast non-ssl page 
processing. Here is a possible solution how to switch between ssl and 
normal pages using the extension class "strato_ssl_html". It is a "fire and
forget" solution, you do not even need to change the action="target.php" in
your forms to have them make ssl with STRATO. If your forms work before 
introducing SSL, they will work afterwards, too.

# 1.) Include both classes (base and extension)

include '../../scripts/ezhtml/inc_html.php';
include '../../scripts/ezhtml/inc_strato_html.php';

# 2.) Instantiate an object of strato_ssl_html

$html = new strato_ssl_html('Buchstaben, Lernprogramm für Vorschulkinder');
$html->cssfile = '../../scripts/css_menu/css_menu.css';
$html->bodyextra = 'bgcolor="#CCCCCC"';

$html->refresh = true; // always refresh the page
$html->ob = true; // zip it to the browsers that can take zipped input

Do NOT call $html->head() yet.

# 3.) Make the ordering pages ssl, the others normal http

if( substr( $SCRIPT_URI, 0, 15 ) == 'https://www.ssl' )
{
  switch( $thema )
  {
    case 'bestellen2':
    #
    # nach der fertigen Bestellung umschalten? Könnte eigentlich entfallen
    #
    echo '<meta http-equiv="refresh" content="6;URL=http://www.ingoknito.de/produkte/buchstaben">'; // default thema=beschreibung
    break;
    
    case 'bestellen': break; // Die Bestellseite soll ssl bleiben.
    
    default:
    $html->header_no_ssl( $html->url_from_uri() ); // Alle anderen sind ohne SSL
    
  } // switch $thema
} // if https
else
{
  if( $HTTP_HOST == 'www.ingoknito.de' )
  {
    #
    # Die Bestellseite soll natürlich als SSL geladen werden
    #
    if( $thema == 'bestellen' )
    {
      $html->header_ssl( $html->url_from_uri() ); 
    }
  }
} // it is not https

...

# 4.) other $html->head() stuff, then $html->body() and the rest follows.

I hope this doc is useful to you. Make the best of it.

Gruß, Peter Klauer