WackoWiki: Aha/AdaptedActionsCollection/AuthFeedback ...

Home Page | Изменения | Новые Комменты | Пользователи | Каталог | Регистрация | Вход:  Пароль:  

authfeedback.php

<?php

// Displays a form to send feedback to the site administrator, as specified in wakka.config.php
// It first validates the form, then sends it using the mail() function;
echo "Mitteilung/Feedback/Anregung an den Wiki-Administrator von <b>".$this->GetUserName()."</b>:";
$form =      $this->FormOpen().
            
"\n<input name=\"name\" value=\"".$this->GetUserName()."\" type=\"hidden\" /><br />".
            
"\n<input type=\"hidden\" name=\"mail\" value=\"result\">".
            
"\nE-Mail:<br /><input name=\"email\" value=\"".$_POST["email"]."\" type=\"text\" /><br /><br />".
            
"\nMitteilung/Feedback/Anregung:<br />\n<textarea name=\"comments\" rows=\"15\" cols=\"40\">".$_POST["comments"]."</textarea><br / >".
            
"\n<input type=\"submit\" value=\"Senden\" />".
            
$this->FormClose();

if (
$_POST["mail"]=="result") {
    
$name = $this->GetUserName();
    
$email = $_POST["email"];
    
$comments = $_POST["comments"];
    list(
$user, $host) = sscanf($email, "%[a-zA-Z0-9._-]@%[a-zA-Z0-9._-]");
    if (!
$name) {
        
// a valid name must be entered
        
echo "<p class=\"error\">Bitte den Namen eingeben</p>";    
        echo
$form;    
    } elseif (!
$email || !strchr($email, "@") || !$user || !$host) {
        
// a valid email address must be entered
        
echo "<p class=\"error\">Bitte die E-Mail-Adresse eingeben</p>";    
        echo
$form;
    } elseif (!
$comments) {
        
// some text must be entered
        
echo "<p class=\"error\">Bitte eine Nachricht eingeben</p>";    
        echo
$alert;
        echo
$form;
    } else {
        
// send email and display message
        
$msg = "Name:\t".$name."\n";
        
$msg .= "E-Mail:\t".$email."\n";
        
$msg .= "\n".$comments."\n";
        
$recipient = $this->GetConfigValue("admin_email");
        
$subject = "Feedback from ".$this->GetConfigValue("wakka_name");
        
$mailheaders = "From:".$email."\n";
        
$mailheaders .= "Reply-To:".$email;
        
mail($recipient, $subject, $msg, $mailheaders);
        echo
$this->Format("\nDanke für das Interesse! Folgende Nachricht wurde erfolgreich versandt:\n");
        echo
$this->Format("---- **Name:** ".$name."---**E-Mail:** ".$email."---**Text:** ---".$comments);
        echo
$this->Format("----Zurück zur [[".$this->GetConfigValue("root_page")." Startseite]]");
        
// optionally displays the feedback text

    
}    
} else {
    echo
$form;
}

?>

 
Файлов нет. [Показать файлы/форму]
Комментариев нет. [Показать комментарии/форму]
Donate
Время работы: 0.193 s
Использовано памяти: 1.503 Mb