Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][HTML]Formularz i polskie znaki, Przepraszam. Pewnie wałkowany 1000 razy ale nie mogę tego zrobić
MarianBeast
post 10.03.2015, 21:37:34
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 10.03.2015

Ostrzeżenie: (0%)
-----


Czy ktoś mógłby mi pomóc.. już sto razy zmieniałem kod ale ciągle mam krzaki .. nie potrafię tego zrobić..
Chyba, że ktoś chciałby sie podzielić jakimś sprawdzonym formularzem który mogę dowolnie sformatować.. Byłbym bardzo wdzięczny za pomoc.

Kod HTML: ===============================================================

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>A Nice &amp; Simple Contact Form</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>

<div id="page-wrap">

<img src="images/title.gif" alt="A Nice &amp; Simple Contact Form" /><br /><br />
<p>By <a href="http://css-tricks.com">CSS-Tricks</a></p>

<p>There are a million contact form examples on the web, why this one? Because it's SIMPLE, it's FREE, it WORKS, it's VALID, and it's primarily styled with CSS.</p>

<p>If you are trying to contact CSS-Tricks, DO NOT USE THIS FORM. This is just an example, my real <a href="http://css-tricks.com/contact/">contact form is here</a>.</p>

<p><a href="http://css-tricks.com/examples/NiceSimpleContactForm.zip">[DOWNLOAD THIS EXAMPLE]</a></p>

<div id="contact-area">

<form method="post" action="contactengine.php">
<label for="Name">Name:</label>
<input type="text" name="Name" id="Name" />

<label for="City">City:</label>
<input type="text" name="City" id="City" />

<label for="Email">Email:</label>
<input type="text" name="Email" id="Email" />

<label for="Message">Message:</label><br />
<textarea name="Message" rows="20" cols="20" id="Message"></textarea>

<input type="submit" name="submit" value="Submit" class="submit-button" />
</form>

<div style="clear: both;"></div>

<p>Check out a <a href="http://css-tricks.com/examples/NiceSimpleContactForm2">version of this</a> with SPAM protection.</p>

</div>

</div>

</body>

</html>



Kod PHP: ======================================================

<?php

$EmailFrom = "bestiax13@wp.pl";
$EmailTo = "bestiax13@wp.pl";
$Subject = "Wiadomość ze strony Geo-Trans";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));

// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Go to the top of the page
+Quote Post
Raito
post 10.03.2015, 21:48:32
Post #2





Grupa: Zarejestrowani
Postów: 156
Pomógł: 19
Dołączył: 27.04.2014

Ostrzeżenie: (0%)
-----


Poczytaj o nagłówkach.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 29.06.2025 - 12:09