Chce na stronie umiescic formularz do wysyłania zapytania na skrzynke mailowa. Mam dwa pliki:
formularz.html
Cytat
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" text="#FFFFFF" bgcolor="#1B1B1B">
<form name="form1" method="post" action="mail.php">
<div align="center">
<table border="0" width="81%" cellspacing="0" cellpadding="0" height="35" id="table6">
<tr>
<td width="50%" height="35">
</td>
<td height="35">
<p style="text-indent: 0; word-spacing: 0; line-height: 100%; margin: 0" align="center">
</p>
</td>
</tr>
<tr>
<td width="100%" height="35" valign="top" colspan="2">
<p style="text-indent: 0; word-spacing: 0; line-height: 100%; margin: 0" align="center">Treść zapytania:</p>
<p style="text-indent: 0; word-spacing: 0; line-height: 100%; margin: 0" align="center">
<font color="#69513D">
<textarea name="tresc" rows="10" cols="70" wrap="physical" style="border:1px solid #666666; font-family: Verdana; font-size: 10px; color:#FFFFFF; background-color:#000000"></textarea></font>
</td>
</tr>
</table>
</div>
</center>
<p style="text-indent: 0; word-spacing: 0; margin-left: 7; margin-right: 7; margin-top: 0; margin-bottom: 0" align="right">
</p>
<p style="text-indent: 0; word-spacing: 0; margin-left: 7; margin-right: 7; margin-top: 0; margin-bottom: 0" align="center">
<font color="#594335">
<input name="reset" type="reset" class="submit" value="usuń"></font>
<font color="#444444"> <input name="submit" type="submit" class="submit" value="wyślij"><input type="hidden" name="subject" value="Mail ze strony WWW"></font></p>
</form>
</BODY>
</HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" text="#FFFFFF" bgcolor="#1B1B1B">
<form name="form1" method="post" action="mail.php">
<div align="center">
<table border="0" width="81%" cellspacing="0" cellpadding="0" height="35" id="table6">
<tr>
<td width="50%" height="35">
</td>
<td height="35">
<p style="text-indent: 0; word-spacing: 0; line-height: 100%; margin: 0" align="center">
</p>
</td>
</tr>
<tr>
<td width="100%" height="35" valign="top" colspan="2">
<p style="text-indent: 0; word-spacing: 0; line-height: 100%; margin: 0" align="center">Treść zapytania:</p>
<p style="text-indent: 0; word-spacing: 0; line-height: 100%; margin: 0" align="center">
<font color="#69513D">
<textarea name="tresc" rows="10" cols="70" wrap="physical" style="border:1px solid #666666; font-family: Verdana; font-size: 10px; color:#FFFFFF; background-color:#000000"></textarea></font>
</td>
</tr>
</table>
</div>
</center>
<p style="text-indent: 0; word-spacing: 0; margin-left: 7; margin-right: 7; margin-top: 0; margin-bottom: 0" align="right">
</p>
<p style="text-indent: 0; word-spacing: 0; margin-left: 7; margin-right: 7; margin-top: 0; margin-bottom: 0" align="center">
<font color="#594335">
<input name="reset" type="reset" class="submit" value="usuń"></font>
<font color="#444444"> <input name="submit" type="submit" class="submit" value="wyślij"><input type="hidden" name="subject" value="Mail ze strony WWW"></font></p>
</form>
</BODY>
</HTML>
mail.php
Cytat
<?php
if (count($_POST))
{
////////// USTAWIENIA //////////
$email = 'moj_adres@op.pl'; // Adres e-mail adresata
$subject = 'temat'; // Temat listu
$message = 'Dziękujemy za wysłanie formularza'; // Komunikat
$error = 'Wystąpił błąd podczas wysyłania formularza'; // Komunikat błędu
$charset = 'iso-8859-2'; // Strona kodowa
//////////////////////////////
$head =
"MIME-Version: 1.0\r\n" .
"Content-Type: text/plain; charset=$charset\r\n" .
"Content-Transfer-Encoding: 8bit";
$body = '';
foreach ($_POST as $name => $value)
{
if (is_array($value))
{
for ($i = 0; $i < count($value); $i++)
{
$body .= "$name=$value[$i]\r\n";
}
}
else $body .= "$name=$value\r\n";
}
echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error;
}
else
{
?>
if (count($_POST))
{
////////// USTAWIENIA //////////
$email = 'moj_adres@op.pl'; // Adres e-mail adresata
$subject = 'temat'; // Temat listu
$message = 'Dziękujemy za wysłanie formularza'; // Komunikat
$error = 'Wystąpił błąd podczas wysyłania formularza'; // Komunikat błędu
$charset = 'iso-8859-2'; // Strona kodowa
//////////////////////////////
$head =
"MIME-Version: 1.0\r\n" .
"Content-Type: text/plain; charset=$charset\r\n" .
"Content-Transfer-Encoding: 8bit";
$body = '';
foreach ($_POST as $name => $value)
{
if (is_array($value))
{
for ($i = 0; $i < count($value); $i++)
{
$body .= "$name=$value[$i]\r\n";
}
}
else $body .= "$name=$value\r\n";
}
echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error;
}
else
{
?>
po umieszczeniu na serwerze i kliknieciu wyslij pojawia sie
Cytat
The page cannot be displayed
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
HTTP Error 405 - The HTTP verb used to access this page is not allowed.
Internet Information Services (IIS)
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
HTTP Error 405 - The HTTP verb used to access this page is not allowed.
Internet Information Services (IIS)
i nie wiem co z tym zrobic
Z php jestem nowicjuszem i dopiero zaczynam. Konto mam na webserwer.pl Moze jakos najpierw musze aktywowac php?