home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / feedback / index.php
Encoding:
PHP Script  |  2002-09-16  |  3.7 KB  |  96 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* Based on php Addon Feedback 1.0                                      */
  11. /* Copyright (c) 2001 by Jack Kozbial                                   */
  12. /* http://www.InternetIntl.com                                          */
  13. /* jack@internetintl.com                                                */
  14. /*                                                                      */
  15. /* This program is free software. You can redistribute it and/or modify */
  16. /* it under the terms of the GNU General Public License as published by */
  17. /* the Free Software Foundation; either version 2 of the License.       */
  18. /************************************************************************/
  19.  
  20. if (!eregi("modules.php", $PHP_SELF)) {
  21.     die ("You can't access this file directly...");
  22. }
  23.  
  24. require_once("mainfile.php");
  25. $module_name = basename(dirname(__FILE__));
  26. get_lang($module_name);
  27.  
  28. /**********************************/
  29. /* Configuration                  */
  30. /*                                */
  31. /* You can change this:           */
  32. /* $index = 0; (right side off)   */
  33. /**********************************/
  34. $index = 1;
  35. $subject = "$sitename "._FEEDBACK."";
  36. /**********************************/
  37.  
  38. include("header.php");
  39.  
  40. $form_block = "
  41.     <center><font class=\"title\"><b>$sitename: "._FEEDBACKTITLE."</b></font>
  42.     <br><br><font class=\"content\">"._FEEDBACKNOTE."</font>
  43.     <FORM METHOD=\"post\" ACTION=\"modules.php?name=$module_name\">
  44.     <P><strong>"._YOURNAME.":</strong><br>
  45.     <INPUT type=\"text\" NAME=\"sender_name\" VALUE=\"$sender_name\" SIZE=30></p>
  46.     <P><strong>"._YOUREMAIL.":</strong><br>
  47.     <INPUT type=\"text\" NAME=\"sender_email\" VALUE=\"$sender_email\" SIZE=30></p>
  48.     <P><strong>"._MESSAGE.":</strong><br>
  49.     <TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual>$message</TEXTAREA></p>
  50.     <INPUT type=\"hidden\" name=\"opi\" value=\"ds\">
  51.     <P><INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\""._SEND."\"></p>
  52.     </FORM></center>
  53. ";
  54.  
  55. OpenTable();
  56. if ($opi != "ds") {
  57.     echo "$form_block";
  58. } elseif ($opi == "ds") {
  59.     if ($sender_name == "") {
  60.     $name_err = "<center><font class=\"option\"><b><i>"._FBENTERNAME."</i></b></font></center><br>";
  61.     $send = "no";
  62.     } 
  63.     if ($sender_email == "") {
  64.     $email_err = "<center><font class=\"option\"><b><i>"._FBENTEREMAIL."</i></b></font></center><br>";
  65.     $send = "no";
  66.     } 
  67.     if ($message == "") {
  68.         $message_err = "<center><font class=\"option\"><b><i>"._FBENTERMESSAGE."</i></b></font></center><br>";
  69.     $send = "no";
  70.     } 
  71.     if ($send != "no") {
  72.     $msg = "$sitename\n\n";
  73.     $msg .= ""._SENDERNAME.": $sender_name\n";
  74.     $msg .= ""._SENDEREMAIL.": $sender_email\n";
  75.     $msg .= ""._MESSAGE.": $message\n\n";
  76.     $to = $adminmail;
  77.     $mailheaders = "From: $sender_name <$sender_email>\n";
  78.     $mailheaders .= "Reply-To: $sender_email\n\n";
  79.     mail($to, $subject, $msg, $mailheaders);
  80.     echo "<P><center>"._FBMAILSENT."</center></p>";
  81.     echo "<P><center>"._FBTHANKSFORCONTACT."</center></p>";
  82.     } elseif ($send == "no") {
  83.     OpenTable2();
  84.     echo "$name_err";
  85.     echo "$email_err";
  86.     echo "$message_err";
  87.     CloseTable2();
  88.     echo "<br><br>";
  89.     echo "$form_block";  
  90.     } 
  91. }
  92.  
  93. CloseTable();   
  94. include("footer.php");
  95.  
  96. ?>