Problem z zamieszczeniem E-mail na stronie.

Forum poświęcone skryptom, językom programowania, serwerom i hostingowi, domenom itp.
Tomal_3
Posty: 1
Rejestracja: 13 listopada 2012, 05:41

Problem z zamieszczeniem E-mail na stronie.

Post autor: Tomal_3 » 13 listopada 2012, 05:54

Witam serdecznie.
Na początku chciałbym się przywitać. Mam na imię Tomek.
Mam pewien problem. Robię stronę internetową dla kolegi i chciałem na niej umieścić funkcję wysłania emaila bezpośrednio ze strony. Nie mogę sobie z tym poradzić czy ktoś mógłby mi pomóc? Powiem że stronka którą robię jest z gotowego szablonu tylko jest zmieniona graficznie i mam kod dotyczący tego maila ale nie potrafę go skonfigurować. Bardzo proszę o pomoc.

Mail ma być wysyłany na adres: info@allserwis.eu
Po wysłaniu napis: Dziękujemy za kontakt. Odpowiedź otrzymają Państwo w ciągu najbliższych 24 godzin. Pozdrawiamy Zespół AllSerwis.

Poniżej zameszczam kod który był na gotowej stronce.
Bardzo proszę o pomoc ne mogę sobie z tym poradzć,
<?php // This PHP Contact Form is offered "as is" without warranty of any kind, either expressed or implied.
// David Carter at http://www.css3templates.co.uk shall not be liable for any loss or damage arising from, or in any way
// connected with, your use of, or inability to use, the website templates (even where David Carter has been advised
// of the possibility of such loss or damage). This includes, without limitation, any damage for loss of profits,
// loss of information, or any other monetary loss.
// Set-up these 3 parameters
// 1. Enter the email address you would like the enquiry sent to
// 2. Enter the subject of the email you will receive, when someone contacts you
// 3. Enter the text that you would like the user to see once they submit the contact form
$to = 'info@allserwis.eu';
$subject = 'Dziękujemy za kontakt. Odpowiedź otrzymają Państwo w ciągu najbliższych 24 godzin. Pozdrawiamy Zespół AllSerwis';
$contact_submitted = 'Twoja wiadomość została wysłana. Pozdrawiamy Zespół AllSerwis.';
// Do not amend anything below here, unless you know PHP
function email_is_valid(info@allserwis.eu) {
return preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i',$email);
}
if (!email_is_valid($info@allserwis.eu)) {
echo '<p style="color: red;">You must set-up a valid (info@allserwis.eu) email address before this contact page will work.</p>';
}
if (isset($_POST['Twoja wiadomość została wysłana. Pozdrawiamy Zespół AllSerwis.'])) {
$return = "\r";
$youremail = trim(htmlspecialchars($_POST['info@allserwis.eu']));
$yourname = stripslashes(strip_tags($_POST['your_name']));
$yourmessage = stripslashes(strip_tags($_POST['your_message']));
$contact_name = "Name: ".$yourname;
$message_text = "Message: ".$yourmessage;
$user_answer = trim(htmlspecialchars($_POST['user_answer']));
$answer = trim(htmlspecialchars($_POST['answer']));
$message = $contact_name . $return . $message_text;
$headers = "From: ".$youremail;
if (email_is_valid(info@allserwis.eu) && !eregi("\r",info@allserwis.eu) && !eregi("\n",info@allserwis.eu) && $yourname != "" && $yourmessage != "" && substr(md5($user_answer),5,10) === $answer) {
mail($info@allserwis.eu,$Dziękujemy za kontakt. Odpowiedź otrzymają Państwo w ciągu najbliższych 24 godzin. Pozdrawiamy Zespół AllSerwis,$message,$headers);
$yourname = '';
$youremail = '';
$yourmessage = '';
echo '<p style="color: blue;">'.$Twoja wiadomość została wysłana. Pozdrawiamy Zespół AllSerwis..'</p>';
}
else echo '<p style="color: red;">Proszę wpisać prawidłowe dane zanim wyślesz wiadomość e-mail. }
$number_1 = rand(1, 9);
$number_2 = rand(1, 9);
$answer = substr(md5($number_1+$number_2),5,10);
?>
<form id="contact" action="contact.php" method="post">
<div class="form_settings">
<p><span>Name</span><input class="contact"
name="your_name" value="<?php echo $yourname; ?>"
type="text"></p>
<p><span>Email Address</span><input
class="contact" name="info@allserwis.eu"
value="<?php echo $info@allserwis.eu; ?>" type="text"></p>
<p><span>Message</span><textarea
class="contact textarea" rows="5" cols="50"
name="your_message"><?php echo $yourmessage; ?></textarea></p>
<p style="line-height: 1.7em;">To help prevent spam,
please enter the answer to this question:</p>
<p><span><?php echo $number_1; ?> +<?php echo $number_2; ?>
= ?</span><input name="user_answer" type="text"><input
name="answer" value="<?php echo $answer; ?>"
type="hidden"></p>
<p style="padding-top: 15px;"><span>&nbsp;</span><input
class="submit" name="contact_submitted" value="send"
type="submit"></p>
</div>
</form>
</div>
<div id="right_content">
<img src="images/contact.jpg" title="contact"
alt="contact" height="450" width="450"></div>
</div>
<!-- end content -->
<!-- begin footer --><footer>
</footer>
Pozdrawam Tomek
Ostatnio zmieniony 13 listopada 2012, 19:16 przez jaroslw, łącznie zmieniany 1 raz.
Powód: Temat nie ma żadnego związku z phpBB. Przenoszę.

ODPOWIEDZ

Wróć do „Webmastering”