Login   Register  
PHP Classes
elePHPant
Icontem

File: guestbook.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  >  guestbook.php  >  Download  
File: guestbook.php
Role: Example script
Content type: text/plain
Description: the user part
Class: Guestbooks
Manage guestbooks or simple blogs using MySQL
Author: By
Last change:
Date: 2012-04-24 17:09
Size: 1,304 bytes
 

Contents

Class file image Download
<?php
    
include_once('guestbook.class.php');
    
$guestbookUser = new guestbookUser();
    if(isset(
$_REQUEST['submit'])){
        
$guestbookUser->name $_REQUEST['name'];
        
$guestbookUser->text $_REQUEST['text'];
        
$guestbookUser->imgURL $_REQUEST['image'];
        
$guestbookUser->email $_REQUEST['email'];
        
$guestbookUser->headline $_REQUEST['headline'];    
        
$guestbookUser->createBlogEntry();
        
header ('location: guestbook.php?accept=1');        
    }    
    
?>
    <form action="guestbook.php" method="post">
        image :
        <select name="image" style="width:200px">
            <option value="user.jpg"> -- </option>
            <option value="image1.jpg"> Image 1 </option>
            <option value="image2.jpg"> Image 2 </option>
        </select>
        <br />
        Headline: <input type="text" name="headline" style="width:200px" /><br />
        Name: <input type="text" name="name" style="width:200px" /><br />
        Email: <input type="text" name="email" style="width:200px" /><br />
        <textarea name="text" style="width:400px;height:150px;"></textarea><br />
        <input type="submit" name="submit" value="Submit" />
    </form>
    <?php    
    
if(isset($_REQUEST['accept'])){
        echo 
"An e-mail has been send to your e-mail, please read it to verify your entry.<br />";
    }
    echo 
$guestbookUser->displayResults($guestbookUser->readAllguestbook());    
?>