bercow
07-05-2011, 22:24
Witam.
Zastosowałem taki myk, aby wykorzystać formularz kontaktowy w artykule, ale nie wiedzieć czemu, odrazu po wejsciu na strone wiadomosc zostaje wyslana.
{source}
<div id="formkontakt">
<form action="index.php?option=com_content&view=article&id=99&Itemid=92" method="post">
<input type="text" name="email" value="email" onfocus="if(value==defaultValue)value=''" onblur="value=value||defaultValue"" /><br />
<textarea name="content" cols="30" rows="6" onFocus="if (this.value == this.defaultValue) { this.value = ''; }" >Temat i treść</textarea>
<input type="submit" value="wyślij" />
</form></div>
<!-- You can place html anywhere within the source tags -->
<script language="javascript" type="text/javascript">
// You can place JavaScript like this
</script>
<?php
@$email = $_POST['email'];
@$content = $_POST['content'];
$header = "From: adres \nContent-Type:".
' text/plain;charset="iso-8859-2"'.
"\nContent-Transfer-Encoding: 8bit";
if (mail('Optyk <bercow.piotr@gmail.com>', $email, $content, $header))
echo '`';
else
echo '<p><b>NIE</b> wysłano maila!</p>';
?>
{/source}
Zastosowałem taki myk, aby wykorzystać formularz kontaktowy w artykule, ale nie wiedzieć czemu, odrazu po wejsciu na strone wiadomosc zostaje wyslana.
{source}
<div id="formkontakt">
<form action="index.php?option=com_content&view=article&id=99&Itemid=92" method="post">
<input type="text" name="email" value="email" onfocus="if(value==defaultValue)value=''" onblur="value=value||defaultValue"" /><br />
<textarea name="content" cols="30" rows="6" onFocus="if (this.value == this.defaultValue) { this.value = ''; }" >Temat i treść</textarea>
<input type="submit" value="wyślij" />
</form></div>
<!-- You can place html anywhere within the source tags -->
<script language="javascript" type="text/javascript">
// You can place JavaScript like this
</script>
<?php
@$email = $_POST['email'];
@$content = $_POST['content'];
$header = "From: adres \nContent-Type:".
' text/plain;charset="iso-8859-2"'.
"\nContent-Transfer-Encoding: 8bit";
if (mail('Optyk <bercow.piotr@gmail.com>', $email, $content, $header))
echo '`';
else
echo '<p><b>NIE</b> wysłano maila!</p>';
?>
{/source}