|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2004
Location: Brazil
Posts: 91
|
Mail being send twice or more
Hi all,
I have this php script in simple contact page, but it seems do send the mail twice or even more. Can someone give me a hand plz? The code is down below... Thanks all! PHP Code:
HTML Code:
<?php if(isset($_POST['submit'])) { ?> window.location = "mailsent.html"; setDialog(true); <?php } else if(isset($_POST['NULL'])) { ?> window.location = "erromail.html"; <?php } ?> </script> <form method="post" name="contato" action="contato.php" onsubmit="return checkValue();"> <table width="500" class="formulario"> <tr> <th width="215" scope="row">Nome / Empresa: </th> <td width="269"> <input type="text" name="nome" size="45" maxlength="45" class="fieldBlur" onFocus="this.className = 'fieldFocus'" onBlur="this.className = 'fieldBlur'"/> </td> </tr> <tr> <th scope="row">Email:</th> <td><input type="text" name="mail" size="45" maxlength="45" class="fieldBlur" onFocus="this.className = 'fieldFocus'" onBlur="this.className = 'fieldBlur';"/></td> </tr> <tr> <th scope="row">Cidade / Estado (UF):</th> <td><input type="text" name="cidade" size="45" maxlength="45" class="fieldBlur" onFocus="this.className = 'fieldFocus'" onBlur="this.className = 'fieldBlur'"/> <input type="text" name="uf" size="2" maxlength="2" class="fieldBlur" onFocus="this.className = 'fieldFocus'" onBlur="this.className = 'fieldBlur'"/> </td> </tr> <tr> <th scope="row">DDD / Telefone: </th> <td> <input type="text" name="ddd" size="2" maxlength="2" class="fieldBlur" onFocus="this.className = 'fieldFocus'" onBlur="this.className = 'fieldBlur'" onKeyUp="setNumber(this)" /> <input type="text" name="telefone" size="8" maxlength="8" class="fieldBlur" onFocus="this.className = 'fieldFocus'" onBlur="this.className = 'fieldBlur'" onKeyUp="setNumber(this)" /> </td> </tr> <tr> <th scope="row" valign="top">Dúvidas, sugestões ou críticas </th> <td> <textarea name="comentario" rows="5" cols="45" class="fieldBlur" onFocus="this.className = 'fieldFocus'" onBlur="this.className = 'fieldBlur'"></textarea> </td> </tr> <tr> <th colspan="2" scope="row"> <input type="submit" name="action" value="Enviar" class="actions" /> <input type="reset" name="action" value="Limpar" class="actions" /> </th> </tr> </table> </form> |
|
|
|
|
|
#2 |
|
SitePoint Zealot
![]() ![]() Join Date: Sep 2002
Location: Netherlands
Posts: 127
|
hmm isn't it a header injection problem? or mail box settings
becouse it should run fine.. |
|
|
|
|
|
#3 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2004
Location: Brazil
Posts: 91
|
Hey,
It has happened in different pcs, so I guess it isn´t mail configuration. About the header, I´m not sure, the script is being attached before the html definition, maybe that´s the problem? |
|
|
|
|
|
#4 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2004
Location: Brazil
Posts: 91
|
Well,
I´ll post the full php, maybe someone can give me a light about this problem? Thanks all! PHP Code:
|
|
|
|
|
|
#5 |
|
Follow Me On Twitter: @djg
![]() ![]() ![]() ![]() ![]() Join Date: Aug 2000
Location: Philadephia, PA
Posts: 19,741
|
There's nothing conditional about sending the mail -- it sends even when displaying the blank form, before it's filled out.
Check that something was entered before mailing. |
|
|
|
|
|
#6 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2004
Location: Brazil
Posts: 91
|
Hey,
I´m really new about php, can you give me direction about what should I check if null or not? Thanks! |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 21:46.













Linear Mode
