Login   Register  
PHP Classes
elePHPant
Icontem

File: createdb.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2012-04-24 17:07
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?";
    }
?>