PHP Classes

File: contact.php

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra  >  Giga CMS  >  contact.php  >  Download  
File: contact.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Giga CMS
Multi-user content management system
Author: By
Last change:
Date: 5 years ago
Size: 2,224 bytes


Class file image Download
include "inc/init.php";

$page->title = "Contact to ". $set->site_name;
$page->description = "contact us $set->site_name";
$page->keyword = "contact us $set->site_name, get in touch $set->site_name";

$presets->setActive("contactus"); // we highlith the contact link

if($_POST && isset($_SESSION['token']) && ($_SESSION['token'] == $_POST['token'])) {

$email = $_POST['email'];
$message = $_POST['message'];

$page->error = "Email address is not valid.";
      else if(!isset(
$page->error = "Message was too short !";
      else {
$from ="From: ".$email;
$sub = "Contact Admin $set->site_name !";
$options->sendMail($email, $sub, $message, $from))
$page->success = "Your message was sent !";

} else if(
$page->error = "Invalid request !";


$_SESSION['token'] = sha1(rand()); // random token

echo "
<div style='padding-top:100px'>
<div class='container'>"

else if(isset(

    <div class='col-sm-offset-1 col-sm-10'>
    <form class='form-horizontal' action='#' method='post'>
                    <legend>Contact Us</legend>
                    <div class='form-group'>
                        <label class='col-sm-2 control-label'>Your Email</label>
                        <div class='col-sm-10'>
                        <input type='text' name='email' class='form-control' value='"
.($user->islg() ? $user->filter->email : "")."'>
                    <div class='form-group'>
                        <label class='col-sm-2 control-label'>Message</label>
                        <div class='col-sm-10'>
                        <textarea name='message' rows='5' class='form-control'></textarea>

                       <input type='hidden' name='token' value='"
                    <div class='form-group'>
                        <div class='col-sm-offset-2 col-sm-10'>
                      <button type='submit' id='submit' class='btn btn-primary'>Send</button>

    </div><!-- /container -->"


For more information send a message to info at phpclasses dot org.