neporadí někdo základ scriptu pro odeslání více polí do proměnné $zpráva?
sem v php lama a tak kdyžtak prosím lidskou řečí :)
ukázka chyby je [url=http://001.nazory.cz/kokoko]zde[/url]
předem dík
Fórum › PHP
Mail form please HELP

napr.
$zprava = $_POST[nazov_inputu1]." ".$_POST[nazov_inputu2]." ".$_POST[nazov_inputu3];
a premennu zprava vlozis do funkcie mail()
nevim co furt dělám špatně protože mi to furt nejde
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title>Odesílání emailu</title>
</head>
<body>
<h1>Odesílání emailu</h1>
<?
$predmet = "Registrace závodníka";
$email = $_POST['email'];
$zprava = $_POST[nazov_inputu1]." "
.$_POST[auto]." "
.$_POST[model]." "
.$_POST[obsah]." "
.$_POST[rok]." "
.$_POST[spolujezdec]." "
.$_POST[faktura]." "
.$_POST[email];
if ($predmet!="" and $email!="" and $zprava!="")
{
Mail("kotikp@centrum.cz", $predmet, $zprava, "From: " . $email);
echo "<p><strong>Váš e-mail byl úspěšně odeslán</strong>.</p>";
}
else
{
echo "<p>Váš e-mail se <strong>nepodařilo odeslat</strong> pravděpodobně jste nevyplnili všechny údaje.</p>";
}
?>
</body>
</html>
To kaosboy :
Mail a mail je rozdiel, php je case-sensitive ( napr. $premenna != $pReMENNA )
to iste u funkcii :-) takto ti to nepojde.. musis proste dat mail(..);
marioff to pisal narychlo, bez uvodzoviek alebo apostrofov ti pole $_POST nebude fungovat ak zadavas nazov a nie cislo ( resp musi byt $_POST['auto'] alebo $_POST["auto"] .. iba u cisiel moze byt $_POST[0] a podobne. ale doporucoval by som prvu moznost s cislami je to aspon pre mna neprehladne.. pouzivam to iba niekedy ale pri $_POST urcite nie )
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title>Odesílání emailu</title>
</head>
<body>
<h1>Odesílání emailu</h1>
<?
$predmet = "Registrace";
$email = $_POST['email'];
$zprava = $_POST["auto"]." "
.$_POST["model"]." "
.$_POST["obsah"]." "
.$_POST["rok"]." "
.$_POST["spolujezdec"]." "
.$_POST["faktura"]." "
.$_POST["email"];
if ($email!="" and $zprava!="")
{
mail("muj@mail.cz", $predmet, $zprava, "From: " . $email);
echo "<p><strong>Váš e-mail byl úspěšně odeslán</strong>.</p>";
}
else
{
echo "<p>Váš e-mail se <strong>nepodařilo odeslat</strong> pravděpodobně jste nevyplnili všechny údaje.</p>";
}
?>
</body>
</html>

Přidej příspěvek
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
































Uživatelé prohlížející si toto vlákno
Podobná vlákna
IFrame form — založil Tomas
Refresh Form — založil Anonymní uživatel
2 x form , 2 x submit — založil hbo83
Moderátoři diskuze