Autor | Zpráva | ||
---|---|---|---|
Nikeboy Profil |
Dobry den dělal sem odesílaní emailu pomocí php ale píše mi to blbosti nevím co stim poradte zde máte htlm a php kod
<?php $jmeno = $_POST['jmeno']; $mail = $_POST['mail']; $predmet = $_POST['predmet']; $text = $_POST['text']; $prijemce = "sampservery@seznam.cz"; $zahlavi = "From: " . $mail . "\r\n"; if ( !empty($jmeno) and !empty($mail) and !empty($predmet) and !empty($text)) { mail($prijemce, $predmet, $text, $zahlavi); echo "<h3>Děkuji. Mail byl úspěšně odeslán.</h3>"; } else { echo "<h3>Nevyplnili jste všechna pole. Mail nebyl odeslán.</h3>"; } ?> a html <form action="mail.php" method="post"> Vaše jméno:<br /> <input name="jmeno" type="text" /><br /> Váš e-mail:<br /> <input name="mail" type="text" /><br /> Předmět zprávy:<br /> <input name="predmet" type="text" /><br /> Text zprávy:<br /> <textarea name="text"></textarea><br />> <input type="submit" value="Odeslat" /> <input type="reset" /> </form> |
||
Taps Profil |
#2 · Zasláno: 14. 3. 2012, 19:53:14
Nikeboy:
„ale píše mi to blbosti“ jaké ??? |
||
Nikeboy Profil |
Taps:
> Nikeboy: > „ale píše mi to blbosti“ > jaké ??? toto Děkuji. Mail byl úspěšně odeslán."; } else { echo " Nevyplnili jste všechna pole. Mail nebyl odeslán. "; } ?> |
||
Taps Profil |
#4 · Zasláno: 14. 3. 2012, 19:58:37
Nikeboy:
zkus nahradit logický výraz and za or <?php $jmeno = $_POST['jmeno']; $mail = $_POST['mail']; $predmet = $_POST['predmet']; $text = $_POST['text']; $prijemce = "sampservery@seznam.cz"; $zahlavi = "From: " . $mail . "\r\n"; if ( !empty($jmeno) or !empty($mail) or !empty($predmet) or !empty($text)) { mail($prijemce, $predmet, $text, $zahlavi); echo "<h3>Děkuji. Mail byl úspěšně odeslán.</h3>"; } else { echo "<h3>Nevyplnili jste všechna pole. Mail nebyl odeslán.</h3>"; } ?> |
||
Nikeboy Profil |
#5 · Zasláno: 14. 3. 2012, 20:03:48
pořád
|
||
Someone Profil |
Taps:
„zkus nahradit logický výraz and za or“ „if ( !empty($jmeno) or !empty($mail) or !empty($predmet) or !empty($text)) {“ „<textarea name="text"></textarea><br />>“ |
||
Nikeboy Profil |
#7 · Zasláno: 14. 3. 2012, 20:10:39
zato že ste mi poradili můžete to vyskoušet http://pc-nikeboy.8u.cz/ :DD
|
||
Someone Profil |
#8 · Zasláno: 14. 3. 2012, 20:14:18 · Upravil/a: Someone
|
||
Nikeboy Profil |
#9 · Zasláno: 14. 3. 2012, 20:16:56
nevím :D asi jo sem to předtím měl na webzdarma tak možná v tom byl problém :D
|
||
Someone Profil |
#10 · Zasláno: 14. 3. 2012, 20:17:37
Nikeboy:
„asi jo“ Myslím, že ne, chybu tam stále máš a jde ti to. |
||
Nikeboy Profil |
#11 · Zasláno: 14. 3. 2012, 20:18:12
jakou :D
|
||
Someone Profil |
Someone:
„<textarea name="text"></textarea><br />>“ |
||
Nikeboy Profil |
#13 · Zasláno: 14. 3. 2012, 20:21:39
aha :D input :D
|
||
Someone Profil |
#14 · Zasláno: 14. 3. 2012, 20:22:38
|
||
Nikeboy Profil |
#15 · Zasláno: 14. 3. 2012, 20:23:01
ty emaily se neodesílajou :D
|
||
Someone Profil |
Děkuji. Mail byl úspěšně odeslán. Vyplnil jsem jen text.
|
||
Nikeboy Profil |
#17 · Zasláno: 14. 3. 2012, 20:26:14 · Upravil/a: Nikeboy
už sem to nejak upravil a odesilaji se ale když sem tam dal tyto formuláře tak se to cely neodešle http://pc-nikeboy.8u.cz/indexi.html jen text
potřeboval bych to posílat i s checkbox ale to se neodešle :( |
||
panther Profil |
#18 · Zasláno: 14. 3. 2012, 21:26:52 · Upravil/a: Moderátor (editace znemožněna) 15. 3. 2012, 19:14:51
Moderátor Davex: Přesunuto z duplicity nejdou mi odeslat nektere věci z webu na email.
Nikeboy: konkrétně jméno se ti asi neodešle, prvek s name=jmeno totiž ve formuláři chybí.
Jinak, co si slibuješ od sady polí s name=zahlavir ? Tato hodnota se ti vzájemně přepisuje, do mailu by se ti dostala jen jedna. Ale ty tyto položky stejně nezpracováváš, takže ve formuláři přebývají.
|
||
Nikeboy Profil |
#19 · Zasláno: 14. 3. 2012, 21:28:45 · Upravil/a: Moderátor (editace znemožněna) 15. 3. 2012, 19:15:07
Moderátor Davex: Přesunuto z duplicity nejdou mi odeslat nektere věci z webu na email.
a nešlo by to upravit nejak třeba do php ? http://pc-nikeboy.8u.cz/indexi.html |
||
panther Profil |
#20 · Zasláno: 14. 3. 2012, 21:30:30 · Upravil/a: Moderátor (editace znemožněna) 15. 3. 2012, 19:15:22
Moderátor Davex: Přesunuto z duplicity nejdou mi odeslat nektere věci z webu na email.
Nikeboy: samozřejmě, že by to šlo upravit. Přesně dle toho, co jsem napsal. |
||
Nikeboy Profil |
#21 · Zasláno: 15. 3. 2012, 19:47:30
a upravil by si to pls
|
||
Časová prodleva: 11 dní
|
|||
5Bob5 Profil |
#22 · Zasláno: 26. 3. 2012, 23:03:43
Mám prosbu,
nainstaloval jsem XAMP. Nakonfiguroval jsem si Mercury server a vytvořil dva poštovní účty. Pokud pošlu zprávu pomocí Thunderbirdu vše funguje OK. Pokud pošlu zprávu pomocí PHP tohoto tak to funguje a zpráva příjde na thunderbird stránky vypíše ODESLÁNO. <?php $from_name = "Demo"; $from_email = "demo@localhost.com"; $headers = "From: $from_name <$from_email>"; $body = "Ahoj, tohle je testovací mejl pomocí PHP od: $from_name <$from_email>."; $subject = "Testovací mejlík!!!"; $to = "demo2@localhost.com"; if (@mail($to, $subject, $body, $headers)) { echo "ODESLÁNO!"; } else { echo "CHYBA…"; } ?> Pokud ale pošlu pomocí tohoto tak nic nepříjde stránka napíše E-mail byl odeslán. ale zpráva nepříjde na Thuderbird a ani se neobjeví v okně SMTP serveru Mercury. <? $to = "demo@localhost.com"; $from = "demo2@localhost.com"; $subject = "PHP mail"; $body = "Testovací zpráva pomocí php!"; if (@mail($to, $subject, $body, $from)){ echo ("E-mail byl odeslán.."); } else { echo ("Nepodařilo se e-mail odeslat, ověřte zda jste připojeni k síti.."); } ?> Vůbec nevím čím to může být..... PHP.INI je zde: [mail function] ; For Win32 only. ; http://php.net/smtp ;SMTP = localhost ; http://php.net/smtp-port ;smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from sendmail_from = postmaster@localhost ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = "\"D:\xampp\sendmail\sendmail.exe\" -t" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = Off ; Log all mail() calls including the full path of the script, line #, to address and headers ;mail.log = "D:\xampp\php\logs\php_mail.log" a SENDMAIL.INI je zde ; configuration for fake sendmail ; if this file doesn't exist, sendmail.exe will look for the settings in ; the registry, under HKLM\Software\Sendmail [sendmail] ; you must change mail.mydomain.com to your smtp server, ; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup) ; emails delivered via IIS's pickup directory cause sendmail to ; run quicker, but you won't get error messages back to the calling ; application. smtp_server=localhost ; smtp port (normally 25) smtp_port=25 ; the default domain for this server will be read from the registry ; this will be appended to email addresses when one isn't provided ; if you want to override the value in the registry, uncomment and modify ;default_domain=local ; log smtp errors to error.log (defaults to same directory as sendmail.exe) ; uncomment to enable logging ;error_logfile=error.log ; create debug log as debug.log (defaults to same directory as sendmail.exe) ; uncomment to enable debugging ;debug_logfile=debug.log ; if your smtp server requires authentication, modify the following two lines ;auth_username= ;auth_password= ; if your smtp server uses pop3 before smtp authentication, modify the ; following three lines ;pop3_server= ;pop3_username= ;pop3_password= ; to force the sender to always be the following email address, uncomment and ; populate with a valid email address. this will only affect the "MAIL FROM" ; command, it won't modify the "From: " header of the message content ;force_sender=me@localhost ; sendmail will use your hostname and your default_domain in the ehlo/helo ; smtp greeting. you can manually set the ehlo/helo name if required ;hostname=localhost |
||
Časová prodleva: 12 let
|
0