Hei!
Olen tehnyt palautelomakkeen sivuilleni, mutta olen törmännyt sellaiseen ongelmaan, että lomake ei lähetä joka kerta palautetta s-postiini?
Eli väillä toimii ja välillä ei...
Mistähän voisi johtua tälläinen vika?
Olen tehnyt palautelomakkeen sivuilleni, mutta olen törmännyt sellaiseen ongelmaan, että lomake ei lähetä joka kerta palautetta s-postiini?
Eli väillä toimii ja välillä ei...
Mistähän voisi johtua tälläinen vika?
Vastaukset 8
Vanhimmat
Vaikka se, että koodissa on virhe.
koska tämä on generaattorilla tehty
Ei ne generaattoritkaan erehtymättömiä ole.
Sitä paitsi olisit voinut laittaa koodin esille, vai luuletko, että tässä ollaan jotain selvännäkijöitä.
CHFEEDBACK.PHP Feedback Form PHP Script Ver 2.16.1
Generated by thesitewizard.com's Feedback Form Wizard 2.16.1.
Copyright 2000-2011 by Christopher Heng. All rights reserved.
thesitewizard is a trademark of Christopher Heng.
Get the latest version, free, from:
http://www.thesitewizard.com/wizards/feedbackform.shtml
You can read the Frequently Asked Questions (FAQ) at:
http://www.thesitewizard.com/wizards/faq.shtml
I can be contacted at:
http://www.thesitewizard.com/feedback.php
Note that I do not normally respond to questions that have
already been answered in the FAQ, so *please* read the FAQ.
LICENCE TERMS
1. You may use this script on your website, with or
without modifications, free of charge.
2. You may NOT distribute or republish this script,
whether modified or not. The script can only be
distributed by the author, Christopher Heng.
3. THE SCRIPT AND ITS DOCUMENTATION ARE PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE
IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE. YOU AGREE TO BEAR ALL RISKS AND
LIABILITIES ARISING FROM THE USE OF THE SCRIPT,
ITS DOCUMENTATION AND THE INFORMATION PROVIDED BY THE
SCRIPTS AND THE DOCUMENTATION.
If you cannot agree to any of the above conditions, you
may not use the script.
Although it is not required, I would be most grateful
if you could also link to thesitewizard.com at:
http://www.thesitewizard.com/
Please do not remove any of the above. Don't worry.
If your web host has installed PHP correctly on their
system, neither this notice nor anything you see below
will be displayed in your visitor's web browser. */
// ------------- CONFIGURABLE SECTION ------------------------
$mailto = 'postiositteeni' ;
$subject = "Otsikko" ;
$formurl = "http://lomake.html" ;
$thankyouurl = "http://kiitos.html" ;
$errorurl = "http://www.virhe.html" ;
$email_is_required = 1;
$name_is_required = 1;
$comments_is_required = 1;
$uself = 0;
$use_envsender = 0;
$use_sendmailfrom = 0;
$smtp_server_win = '' ;
$use_webmaster_email_for_from = 0;
$use_utf8 = 1;
$my_recaptcha_private_key = '' ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
define( 'MAX_LINE_LENGTH', 998 );
$headersep = (!isset( $uself ) || !$uself) ? "\r\n" : "\n" ;
$content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' : 'Content-Type: text/plain; charset="utf-8"' ;
if (!isset( $use_envsender )) { $use_envsender = 0 ; }
if (isset( $use_sendmailfrom ) && $use_sendmailfrom) {
ini_set( 'sendmail_from', $mailto );
}
if (isset( $smtp_server_win ) && strlen($smtp_server_win)) {
ini_set( 'SMTP', $smtp_server_win );
}
$envsender = "-f$mailto" ;
$fullname = (isset($_POST['fullname']))? $_POST['fullname'] : $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (($email_is_required && (empty($email) || !preg_match('/@/', $email))) || ($name_is_required && empty($fullname)) || ($comments_is_required && empty($comments))) {
header( "Location: $errorurl" );
exit ;
}
if ( preg_match( "/[\r\n]/", $fullname ) || preg_match( "/[\r\n]/", $email ) ) {
header( "Location: $errorurl" );
exit ;
}
if (strlen( $my_recaptcha_private_key )) {
require_once( 'recaptchalib.php' );
$resp = recaptcha_check_answer ( $my_recaptcha_private_key, $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] );
if (!$resp->is_valid) {
header( "Location: $errorurl" );
exit ;
}
}
if (empty($email)) {
$email = $mailto ;
}
$fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email : $mailto ;
if (function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $fullname\n" .
"Email of sender: $email\n" .
"------------------------- COMMENTS -------------------------\n\n" .
wordwrap( $comments, MAX_LINE_LENGTH, "\n", true ) .
"\n\n------------------------------------------------------------\n" ;
$headers =
"From: \"$fullname\" " . $headersep . "Reply-To: \"$fullname\" " . $headersep . "X-Mailer: chfeedback.php 2.16.1" .
$headersep . 'MIME-Version: 1.0' . $headersep . $content_type ;
if ($use_envsender) {
mail($mailto, $subject, $messageproper, $headers, $envsender );
}
else {
mail($mailto, $subject, $messageproper, $headers );
}
header( "Location: $thankyouurl" );
exit ;
Name:
Email address:
Comments
Form by thesitewizard.com
form action="feedback.php" method="post"
table border="0" cellpadding="8" cellspacing="8"
tr>Name:Email address:
Comments
input type="submit" value="Send Feedback" />
Form by thesitewizard.com
/td
/tr
/table
/form
http://www.thesitewizard.com/wizards/feedbackform.shtml
Tuolla nyt jokatapauksessa on se koodi kun en tähän saanut tuota itse lomaketta näkyviin..
Erikoista vain tosiaan on kun joskus tulee viesti perille ja joskus ei, olisiko tuossa palvelin asiassa jotain häikkää sitten...
niitä' vastauksia kiitos