Location: PHPKode > projects > PHP easy ticket and help system > php-easy-ticket-and-help-system/index.php
Name: install.php
Description: submission form for pets ( php easy ticket system )
Purpose: main subbmission form.
Maker: lee johnstone
Site: www.freakcms.com
Support: hide@address.com


1. Use this for commercial usage
2. Claim the code as your own
3. Remove any copyrights from its original authors


1. Upgrade, Update, Adjust, Modify this script, providing you keep all original comments.
2. Redistribute this code under the same license and none other.
3. Modify and use this script on your own site as you wish, providing you keep the copyright markings from original authors.

More information here.


* Start of the class usage
* in this example it shows how to use 
* this script to its full advantage.
* include 'class.tickets.php'; - include the class (needed)
* $ticket = new tickets(); - start the class (needed)
* $ticket->sitename - sets your site name (optional)
* $ticket->pagetitle - sets your page title (optional)
* $ip=$_SERVER['REMOTE_ADDR']; - users ip addedress (needed)
* $tick = $ticket->MakeTicket($_POST['email'],$_POST['fname'],32) - make a new ticket with the users details. (32 can be anything between 10-64 ) (needed)
* $ticket->checkEmail( Email_String, Email_String) - add if you would like to check 2 emails for a match on submission (opt)
* $ticket->CheckSec($_POST['sc']) - add if u would like to check the secert question and answer (opt)
* $ticket->sq - secert question for the forms (needed on forms if security checking is added) (opt)
*  Submission array layout example.
* $data = array(
* 'name' => $_POST['fname'].' '.$_POST['lname'],
* 'email' => $_POST['email'],
* 'site' => $_POST['site'],
* 'ticket' => $tick,
* 'subject' => $_POST['sub'],
* 'msg' => $_POST['msg'],
* 'ip' => $ip,
* 'date' => date('Y-m-d'),
* 'time' => date('g:i:s'),
* 'valid' => 0,
* 'state' => 0
* );
* $ticket->NewTicket($data)- submit the new ticket for user validation.
* --to check a ticket before removing call
* $ticket->CheckToRemove(Ticket_String, Email_String);
* --to remove a ticket call
* $ticket->RemoveTicket(Ticket_String, Email_String);
* --To check the status of a ticket call
* $ticket->CheckStatus(Ticket_String, Email_String);
* '$dontshow' is just used to hide stuff when we dont need it.
* not part of the class and does not need to be used.

include 'data/class.tickets.php';
$ticket = new tickets();

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title><?=$ticket->Cfg[site_name].' '.$ticket->Cfg[page_title];?></title>
<meta name="keywords" content="php, mysql, phpfilter, inputfilter, classes, secure, email, ticketing system, help system, email system">
<meta name="description" content="Easy ticket system 1.0 development site, please visit www.freakcms.com for more information">
<link rel="stylesheet" type="text/css" href="data/css.css" />

<div align="center">
<h1><?=$ticket->Cfg[site_name].' '.$ticket->Cfg[page_title];?></h1>
* get the status of a ticket
$ticket->CheckStatus($_GET['ticket'], $_GET['email']);
$dontshow = true;
* removing a ticket after the form is passed
$ticket->CheckToRemove($_POST['ticket'], $_POST['email']);
$dontshow = true;
* removing a ticket after the validated
$ticket->RemoveTicket($_GET['ticket'], $_GET['email']);
$dontshow = true;
* show the form to remove a ticket

				<form method="POST" action="">
						<h2>Remove Your Submission</h2>
						<p>Enter the Email u used to submit<br>
						<input class="needed" type="text" name="email" size="20"><br>
						Human Check<br>
						<input  class="needed" type="text" name="sc" size="20"><br>
						<input type="hidden" name="ticket" value="<?=$_GET['ticket'];?>"> 
						<input class="button" type="submit" value="Submit your ticket" name="godelete"></p>
$dontshow = true;
* validate a ticket link.
$ticket->ValidateEmailCheck($_GET['ticket'], $_GET['email']);
$dontshow = true;
* submit the new ticket submission
$tick = $ticket->MakeTicket($_POST['email'],$_POST['fname'],32); // make a new ticket with the users details. ( change 32 to which ever value u wish )
$ticket->checkEmail($_POST['email'], $_POST['email2']); 
$data = array(
'name' => $_POST['fname'].' '.$_POST['lname'],
'email' => $_POST['email'],
'site' => $_POST['site'],
'ticket' => $tick,
'subject' => $_POST['sub'],
'msg' => $_POST['msg'],
'ip' => $ip,
'date' => date('Y-m-d'),
'time' => date('g:i:s'),
'valid' => 0,
'state' => 0
* show the submission form
<div align="center">
				<form method="POST" action="">
						<h2>Add Your Submission</h2>
						<p>First Name<br>
						<input class="needed" type="text" name="fname" size="20"  maxlength="50"><br>
						Last Name<br>
						<input class="notneeded" type="text" name="lname" size="20"  maxlength="50"><br>
						<input class="needed" type="text" name="email" size="20"  maxlength="120"><br>
						Email Again<br>
						<input class="needed" type="text" name="email2" size="20" maxlength="120"><br>
						Web Site<br>
						<input class="notneeded" type="text" name="site" size="20" maxlength="120"><br>
						<input class="needed" type="text" name="sub" size="20" maxlength="200"><br>
						<textarea class="needed" rows="13" name="msg" cols="47"></textarea><br>
						<!-- security question start-->
						Human Check<br>
						<input  class="needed" type="text" name="sc" size="20"><br>
						<!-- security question end-->
						<input class="button" type="submit" value="Submit your ticket" name="goticket"></p>

* Please try to keep this intact, even if u mod it to your liking or move it, but its not required.
echo '<div align="center"><a href="'.$ticket->Cfg[adm_link].'">Administration</a><br/>Easy ticket system 1.0 by lee Johnstone <a href="http://www.freakcms.com">www.freakcms.com</a></div>';

Return current item: PHP easy ticket and help system