[Openfirst-cvscommit] feedback index.php,NONE,1.1
Brought to you by:
xtimg
From: <dav...@us...> - 2003-06-08 02:10:06
|
Update of /cvsroot/openfirst/feedback In directory sc8-pr-cvs1:/tmp/cvs-serv13778 Added Files: index.php Log Message: initial upload --- NEW FILE: index.php --- <?php /* * openFIRST.feedback - index.php * * Copyright (C) 2003, * openFIRST Project * Original Author: Tim Ginn <tim...@sy...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ include("../config/globals.php"); include($header); echo("<h1>Feedback</h1>"); mysql_select_db($sqldatabase,$sqlconnection); // Get a list of the users able to // be contacted via the feedback form. $query = mysql_query("SELECT * FROM ofirst_feedbackusers ORDER BY name;"); if (mysql_num_rows($query) != 0){ if(isset($_POST["to"]) == true) { $messageallowed = false; } else { // Display the feedback form. ?> <form method="post" action="feedback.php"> Message To: <select name="to"> <?php } while($feedback = mysql_fetch_object($query)){ if(! isset($_POST["to"])) { echo("<option value='$feedback->email'>$feedback->name</option>"); } else { if ($_POST["to"] == $feedback->email) { $messageallowed = true; } } } if(isset($_POST["to"]) == false) { // Display rest of feedback form. echo("</select>"); ?> <br />Your E-mail Address (used for replies): <input type="text" name="from" style="width: 150px;" /> <br />Type of feedback: <input type="radio" name="type" value="comment" />Comment <input type="radio" name="type" value="question" />Question <input type="radio" name="type" value="concern" />Concern <br /> Message: <br /><textarea name="message" cols="40" rows="20">Insert your feedback here.</textarea> <br /> <input type="submit" value="Send Feedback" /> <input type="reset" value="Clear Feedback" /> </form> <?php } else { if ($messageallowed == true) { // Mail who they wish to contact. mail($_POST["to"], "Feedback: " . $_POST["type"], $_POST["message"] . "\r\n\r\n--\r\nMessage generated by openfirst.feedback. For more information about openFIRST, see: http://openfirst.sourceforge.net" , "From: " . $_POST["from"] ."\r\nReply-To: ". $_POST["from"] ."\r\n"); // Inform user of message being sent. echo("Your message has been sent. If a reply is desired, you should receive it in the near future."); } else { // Give an error. echo("You cannot use the feedback form to contact that person as the administrator of this web site has not allowed it. If you believe you should be able to contact this person, contact the administrator asking them to change their settings."); } } } else { echo("Before you can use this, someone must first set up users able to be e-mailed by modifying the database."); } include($footer); ?> |