PHP Classes
Icontem

File: inc_strato_html.txt


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Peter Klauer  >  ezhtml  >  inc_strato_html.txt  
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
 

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

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products