da das problem im php-script zu liegen scheint, hab ich das topic mal ins dynamische board verschoben :-)
Hi Leute es geht um folgendes habe mir ein formular gebaut
http://l.powered-by.clanserver4u.de/war.htm
das soll an meine e-mail gehen: sumerer@t-online.de
und habe folgendes php-script genommen weiss aber warum es nicht geht.Script liegt bei was muss ich da eintragen in das script.
bei user einstellungen. DAs script liegt auf server unter
http://l.powered-by.clanserver4u.de/formmail.php
da das problem im php-script zu liegen scheint, hab ich das topic mal ins dynamische board verschoben :-)
hi UMAXDJ,
die datei, die man sich da runterladen koennen soll, heisst attachment.php. ist aber eigentlich ein zip. nenn die bitte als erstes mal um.
nur mal so als test: oeffne sie mal vom netz aus mit deinem php-editor ... na?! aegyptisch ... genau!![]()
dann brauchst du nur (falls du auch ein bill-gates-opfer bist) die readme mit dem wordpad oeffnen und da steht es eigentlich schon drin.
brauchst du noch hilfe?
gruss,
theo
also die formail.zip kann mann doch runterladen und entpcken und da drin ist der formailer. der link war nur geschrieben wo ich das ding auf meinem server liegen habe. Weiss jetzt net wo das problem ist.
Ist ASP.. da kann dir glaube ich nicht jeder helfen![]()
nein, ich denk mal er meint den php-formmailer, ich poste den code aus der zip-datei mal hier! in zukunft bitte auch gleich posten bzw. im idealfall den "fehlerhaften" teil posten, dann muss sich nicht jeder die zip-datei runterladen, diese entpacken usw.!
PHP-Code:<?php
/* Copyright (c) 2002 Eli Sand */
########################################################################
# #
# PHP FormMail v2.0 20030305 #
# #
########################################################################
#
# Settings
#
# Initialize variables
#
$auth = NULL;
$deny = NULL;
$must = NULL;
$post = NULL;
$http = NULL;
$form = NULL;
$list = NULL;
# Fix for pre PHP 4.1.x versions
#
if (!isset($_POST)) {
$_POST = &$HTTP_POST_VARS;
}
if (!isset($_SERVER)) {
$_SERVER = &$HTTP_SERVER_VARS;
}
if (!function_exists('array_key_exists')) {
function array_key_exists($key, $array) {return in_array($key, array_keys($array)) ? true : false;}
}
# Fix for magic quotes when enabled
#
if (get_magic_quotes_gpc()) {
foreach ($_POST as $key => $value) {
$_POST["$key"] = stripslashes($value);
}
}
# Detect any Windows operating system
#
if (strstr(php_uname(), 'Windows')) {
$IS_WINDOWS = TRUE;
}
########################################################################
# #
# USER CONFIGURABLE SETTINGS #
# #
########################################################################
# Authorized email address masks that can be used as the recipient
#
$auth = "*@127.0.0.1, *@localhost";
# Authorize all email addresses to the current domain
#
# If you want strict email account authorization, comment this out and
# the script will only authorize the masks in the list defined above.
#
$auth .= ", *@" . get_domain($_SERVER['SERVER_NAME']);
# Email address masks that will be rejected if in the email field
#
$deny = "nobody@*, anonymous@*, postmaster@*";
# The following allow you to set some default settings
#
# These are commented out by default and when used, either override or
# append to any values. This allows you to ensure that hackers don't
# post their own values to certain fields, making you miss out on
# important data that you want to ensure is included in the email.
#
#$must['required'] = "env_report";
#$must['env_report'] = "REMOTE_ADDR";
#$must['redirect'] = "http://my.domain.com/ok.html";
#$must['error_redirect'] = "http://my.domain.com/error.html";
#$must['missing_fields_redirect'] = "http://my.domain.com/missing.html";
#
########################################################################
########################################################################
# #
# DO NOT EDIT ANYTHING PAST THIS POINT #
# #
########################################################################
########################################################################
#
# Functions
#
# Trim leading and trailing white space from array values
#
function array_trim(&$value, $key) {
$value = trim($value);
}
# Return the top level domain of a hostname
#
function get_domain($string) {
if (eregi('\.?([a-zA-Z0-9\-]+\.?[a-zA-Z0-9\-]+)$', $string, $values)) {
return $values[1];
}
return NULL;
}
# Show an error message to the user
#
function error_msg($error, $required = FALSE) {
global $post;
if (!empty($post['missing_fields_redirect']) && $required) {
header('Location: ' . $post['missing_fields_redirect']);
}
elseif (!empty($post['error_redirect'])) {
header('Location: ' . $post['error_redirect']);
}
else {
echo "<html>\r\n";
echo "\t<head>\r\n";
echo "\t\t<title>Form Error</title>\r\n";
echo "\t\t<style type=\"text/css\">* {font-family: \"Verdana\", \"Arial\", \"Helvetica\", monospace;}</style>\r\n";
echo "\t</head>\r\n";
echo "\t<body>\r\n";
echo "\t\t<p>${error}</p>\r\n\t\t<p><small>« <a href=\"javascript: history.back();\">go back</a></small></p>\r\n";
echo "\t</body>\r\n";
echo "</html>\r\n";
}
exit();
}
# Basic pattern matching on an entire array
#
function pattern_grep($input, $array) {
foreach ($array as $value) {
$value = addcslashes($value, '^.[]$()|{}\\');
$value = str_replace('*', '.*', $value);
$value = str_replace('?', '.?', $value);
$value = str_replace('+', '.+', $value);
if (eregi('^' . $value . '$', $input)) {
return TRUE;
}
}
return FALSE;
}
#
########################################################################
########################################################################
#
# Main
#
# Check to make sure the info was posted
#
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$post = array(
'recipient' => $_POST['recipient'],
'email' => $_POST['email'],
'subject' => $_POST['subject'],
'realname' => $_POST['realname'],
'required' => $_POST['required'],
'env_report' => $_POST['env_report'],
'sort' => $_POST['sort'],
'redirect' => $_POST['redirect'],
'error_redirect' => $_POST['error_redirect'],
'missing_fields_redirect' => $_POST['missing_fields_redirect']
);
$http = array(
'REMOTE_USER' => $_SERVER['REMOTE_USER'],
'REMOTE_ADDR' => $_SERVER['REMOTE_ADDR'],
'HTTP_USER_AGENT' => $_SERVER['HTTP_USER_AGENT']
);
if (isset($must['required'])) {
$post['required'] = $must['required'] . ',' . $_POST['required'];
}
if (isset($must['env_report'])) {
$post['env_report'] = $must['env_report'] . ',' . $_POST['env_report'];
}
if (isset($must['redirect'])) {
$post['redirect'] = $must['redirect'];
}
if (isset($must['error_redirect'])) {
$post['error_redirect'] = $must['error_redirect'];
}
if (isset($must['missing_fields_redirect'])) {
$post['missing_fields_redirect'] = $must['missing_fields_redirect'];
}
if (($auth = explode(',', $auth))) {
array_walk($auth, 'array_trim');
}
if (($deny = explode(',', $deny))) {
array_walk($deny, 'array_trim');
}
# Check for missing required fields
#
if ((!empty($post['required'])) && ($list = explode(',', $post['required']))) {
$list[] = 'recipient';
$list[] = 'email';
array_walk($list, 'array_trim');
foreach ($list as $value) {
if (!empty($value) && empty($_POST["$value"])) {
error_msg("You have left a required field blank.", TRUE);
}
}
}
# Check the email addresses submitted
#
if (pattern_grep($post['email'], $deny)) {
error_msg("You have specified a banned email address.");
}
if (!eregi('^([a-zA-Z0-9\.\_\-]+)\@((([a-zA-Z0-9\-]+)\.)+([a-zA-Z]+))$', $post['email'])) {
error_msg("You have specified an invalid email address.");
}
if (!$IS_WINDOWS) {
if (!getmxrr(get_domain($post['email']), $mxhost)) {
error_msg("You have no mail exchange records for your email address.");
}
}
# Check if the recipients email address is authorized
#
if ((!empty($post['recipient'])) && ($list = explode(',', $post['recipient']))) {
array_walk($list, 'array_trim');
foreach ($list as $value) {
if (!eregi('^([a-zA-Z0-9\.\_\-]+)\@((([a-zA-Z0-9\-]+)\.)+([a-zA-Z]+))$', $value)) {
error_msg("The recipients email address is invalid.");
}
if (!pattern_grep($value, $auth)) {
error_msg("The recipients email address is unauthorized.");
}
}
}
else {
error_msg("There was an unknown error while checking the recipients email address.");
}
# Sort the fields
#
if ((!empty($post['sort'])) && ($list = explode(',', $post['sort']))) {
array_walk($list, 'array_trim');
foreach ($list as $value) {
$form["$value"] = $_POST["$value"];
}
}
else {
$form = $_POST;
}
# Create the message
#
$subject = empty($post['subject']) ? "Online form" : "Online form: " . $post['subject'];
$message = "Submitted by: " . $post['realname'] . " <" . $post['email'] . "> on " . date('l, F jS, Y @ g:i:s a (O)') . "\r\n\r\n";
if (!empty($post['env_report'])) {
if (($list = explode(',', $post['env_report']))) {
$message .= "Client Variables\r\n";
$message .= "----------------\r\n\r\n";
array_walk($list, 'array_trim');
foreach ($list as $value) {
if (array_key_exists($value, $http)) {
$message .= "${value}:\r\n" . $http["$value"] . "\r\n\r\n";
}
}
}
}
$message .= "Online Form Fields\r\n";
$message .= "------------------\r\n\r\n";
foreach ($form as $key => $value) {
if (!array_key_exists($key, $post)) {
$message .= "${key}:\r\n${value}\r\n\r\n";
}
}
# Send out the email
#
if (mail($post['recipient'], $subject, $message, "From: " . $post['email'] . "\r\nReply-To: " . $post['email'] . "\r\nX-Mailer: PHP FormMail")) {
if (!empty($post['redirect'])) {
header('Location: ' . $post['redirect']);
}
else {
echo "<html>\r\n";
echo "\t<head>\r\n";
echo "\t\t<title>Thank you</title>\r\n";
echo "\t\t<style type=\"text/css\">* {font-family: \"Verdana\", \"Arial\", \"Helvetica\", monospace;}</style>\r\n";
echo "\t</head>\r\n";
echo "\t<body>\r\n";
echo "\t\t<p>Thank you for filling out the form.</p>\r\n\t\t<p><small>« <a href=\"javascript: history.back();\">go back</a></small></p>\r\n";
echo "\t</body>\r\n";
echo "</html>\r\n";
}
}
else {
error_msg("There was an unknown error while sending email.");
}
}
else {
error_msg("Invalid request method used.");
}
#
########################################################################
?>
genau das meinte ich mit formailer wollte aber net den ganzen script hier reinposten naja nun ist er da.![]()
wie gesagt wenn mann das formular ausgefüllt hat soll das an meine email geschickt werden. sumerer@t-online.de.
hier das formular noch mal
http://l.powered-by.clanserver4u.de/war.htm
hoffe jetzt ist verstänlich
das script kommt mir riesig vor..
--- formular ----
echo "<form action=$PHP_SELF>";
echo "username:<input type=\"text\" name=\"username\"><br>";
echo "password:<input type=\"text\" name=\"password\"><br>";
echo "email:<input type=\"text\" name=\"email\"><br>";
echo "icq:<input type=\"text\" name=\"icq\"><br>";
echo "www:<input type=\"text\" name=\"www\"><br>";
echo "<input type=\"submit\" name=\"submit\" value=\"submit\">";
echo "</form>";
----- email senden ------
// email header
$header="From:$sender_name<$email_from>\n";
$header .="Reply-To: $email_from\n";
$header .="Bcc: $email_bcc\n";
$header .= "X-Mailer: PHP/" . phpversion(). "\n";
$header .= "X-Sender-IP: $REMOTE_ADDR\n";
$header .= "Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable";
//email body erstellen
$email_body = "<a href=\"http://www.crowbar.org/forum/register.php?activate=$code&user=$username\">www.crowbar.org</a>";
mail($email,$email_title,$email_body,$header);
kannst ja auch hier kurz rumbasteln und benötigte felder einbauen. So wie es nun ist gehts.
![]()
http://www.nachdenken.ch - da werden sie nachgedacht
also 1 ich habe keine ahnung von php oder scripten.
2. hab das formular selber gebaut und auf senden mailto: befehl gelegt nur da willoutlook immer erst ein profil erstellen. Dann haben mir welche gesagt mach mit cgi oder php mit cgi hab ich auch schon probiert mit dem script von Formmailer.(siehe anhang)
und hier mit cgi versenden geht aber es kommt keine email bei mir an http://l.powered-by.clanserver4u.de/war1.htm.
Dann habe ich jetzt php probiert mit dem script was hier hinne ist
soll mann oben nur email eintagen und schon gehts aber bis jetzt geht noch nix.
Nun mir ist egal ob php oder cgi hauptsache die mail kommt an.
Also bitte helft mir ich verzweifel schon. Was muss ich ändern bei php oder cgi damit es geht?
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)