Ticket System in PHP - #4 Ticket Creation
Submitted by Yorkiebar on Tuesday, October 7, 2014 - 09:27.
Introduction:
This tutorial is the fourth part in my series of how to create a PHP based ticket system. This part will be covering inserting the generated ticket/random string in to the 'tickets' table within your database.Event:
We only want to insert a new ticket when a certain event occurs, this event will be when the 'Forgotten Password' link or button is clicked/selected. Are you can see from the previous tutorial, I have the following form to begin the process...
This means that when the above form is used, the user will enter their email address for their accoutn, and then click the submit button. When they click the submit button, the information 'emailButton' and 'email' will be sent over 'GET' method to the page 'reset.php'. So, on the 'reset.php' page we will type the following code.
Processing:
First we want to ensure that the email address has been sent... Next we want to set the form variables to local variables...- $email = $_GET['email'];
- $ticket = generateRandom();
- }else{
- echo 'No account found!';
- }
- if ($qq) {
- }else{
- echo 'Unable to create ticket.';
- }
- echo 'Emailed with a ticket!';
Finished!
Add new comment
- 955 views