home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / modules / ticketsmith / do_ticket_aed.php < prev    next >
Encoding:
PHP Script  |  2003-04-03  |  888 b   |  27 lines

  1. <?php
  2. ##
  3. ##    Ticketsmith sql handler
  4. ##
  5.  
  6. $name = isset($HTTP_POST_VARS['name']) ? $HTTP_POST_VARS['name'] : '';
  7. $email = isset($HTTP_POST_VARS['email']) ? $HTTP_POST_VARS['email'] : '';
  8. $subject = isset($HTTP_POST_VARS['subject']) ? $HTTP_POST_VARS['subject'] : '';
  9. $priority = isset($HTTP_POST_VARS['priority']) ? $HTTP_POST_VARS['priority'] : '';
  10. $description = isset($HTTP_POST_VARS['description']) ? $HTTP_POST_VARS['description'] : '';
  11. $description = db_escape($description);
  12.  
  13. $author = $name . " <" . $email . ">";
  14. $tsql =
  15. "INSERT INTO tickets (author,subject,priority,body,timestamp,type) ".
  16. "VALUES('$author','$subject','$priority','$description',UNIX_TIMESTAMP(),'Open')";
  17.  
  18. $rc = mysql_query($tsql);
  19.  
  20. if (!mysql_errno()) {
  21.     $AppUI->setMsg( mysql_error() );
  22.     // add code to mail to ticket master
  23. } else {
  24.     $AppUI->setMsg( "Ticket added" );
  25. }
  26. $AppUI->redirect( "m=ticketsmith" );
  27. ?>