PHP Classes

File: createdb.php

Recommend this page to a friend!
  Classes of Frederik Yssing   Guestbooks   createdb.php   Download  
File: createdb.php
Role: Example script
Content type: text/plain
Description: file to alter database
Class: Guestbooks
Manage guestbooks or simple blogs using MySQL
Author: By
Last change:
Date: 12 years ago
Size: 528 bytes
 

Contents

Class file image Download
<?php
   
include_once('guestbook.class.php');
   
   
// Add your own session logick here
   
session_start();
   
$_SESSION['admin'] = 1;
   
    if(
$_SESSION['admin']){
       
$guestbookAdmin = new guestbookAdmin();
        if(
$guestbookAdmin->createDB())
            echo
"Database and tables created if they did not already exists";
           
        if(isset(
$_REQUEST['del']) && $_REQUEST['del'] == 'true'){
            if(
$guestbookAdmin->destroyTables())
                echo
"Tables have been destroyed if they existed";
        }
    } else {
        echo
"Not admin are you?";
    }
?>