|
#1
|
||||
|
||||
|
hello,
I have spend 1 days and a half, just for doing the mail form in a client site. I think I am a bad designer, and did not know what to do. Can someone help me please? The code that I use in the index.html page is in the attachment, called test.html. Go and download it, and then rename the extension to html. Also, the second page that contain the mail function is also included in the attachment. I use the dream weaver script to validate the email and some fields. So, Can someone help me please fixing the code? My goal in the mail form is: -stop the unwanted (spam) emails. -validate the email shape and any other fields. well, that's all. see you tomorrow. Bye Bye
__________________
Enjoy Being a HostGator Customer
|
|
#2
|
||||
|
||||
|
Two things:
1. Take the quotes out from around the variables (it should be $name, not "$name", and same for the other $variables). 2. This won't prevent spam. Anybody can post any information to the form and it will get emailed to you.
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#3
|
||||
|
||||
|
Quote:
like this: Code:
<?
$name = $_POST['name'];
$email = $_POST['email'];
$comment = $_POST['comment'];
mail("me@mydomain.com", $name, $email, $comment);
echo "Thank you";
echo "<meta http-equiv=Refresh content=5;url=test.html>";
?>
Quote:
The validation form works fine alone and the CAPTCHA works fine alone. I hope I explain the issue good this time. Also, If anyone have any mail form code ready and want to help me out , please post it here...Thank you in advance, OneManShow
__________________
Enjoy Being a HostGator Customer
|
|
#4
|
||||
|
||||
|
Yes, I do mean those places.
Can you show the code you're using for both captcha and mail?
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#5
|
|||
|
|||
|
.html? Shouldn't the files be .php?
I hate CAPTCHA, and so do many other people. Just make typing in a certain word required to send the form. For example: Add the following to the contact file Code:
Type the word "candy": <input type="text" class="input" name="spam" size="10" /> (anti-spam) Code:
if($spam != "candy")
{
echo "Please correctly type the word \"candy\". \n";
die (" ");
}
__________________
Last edited by Adorkable; 07-08-2008 at 01:03 AM. Reason: Correction |
|
#6
|
||||
|
||||
|
here is the whole code that I am trying to fix. It include a validate for:
1-make sure the email input is an email format. 2-make sure that name field,comment, and code fields are not empty. That's I get them from dreamweaver, and they works fine. Now, I used the captcha that was found in this link: http://gscripts.net/free-php-scripts...m_Scripts.html and it's name is: Image Validator , it is the first one. I have tried it alone and it works great. But when I added it to my pages, it did not work. Why? I don't know? I tried a lot of things and nothing works. When I try to write an error code not like the one in the picture, it pass me to the send.php page without giving me any error notice, even I put the If after the form tag. Hope anyone can help me solve this issue? Check the attachment. Thank you in advance, OneManShow
__________________
Enjoy Being a HostGator Customer
|
|
#7
|
||||
|
||||
|
A few things--first, the captcha's setup to have you post to contact.php itself, and have the mail command send from there. That's the Valid : Invalid part. Second, you have a few things wrong with your mail() function. First of all, take the quotes away from the $variables-- it should be $name, $email, etc..... Second, your order of parameters is wrong. Read this:
http://us2.php.net/manual/en/function.mail.php It's mail(to, subject, message, other) (where "from" can be set in other). Why aren't you just using a mail script that is already built to work and includes captcha? There must be some out there...
__________________
Follow me on Twitter! http://twitter.com/mrw |
|
#8
|
||||
|
||||
|
Quote:
I am not stick with this one of mail form, but what I need is a mail form that have captcha and have a validate to the email. That's it. and I want to insert it in my customer template. Thank you for your help, OneManShow
__________________
Enjoy Being a HostGator Customer
|
|
#9
|
||||
|
||||
|
__________________
- David |
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP and mail of form | steph | Shared Hosting Support | 5 | 01-21-2008 06:36 AM |
| Form Mail Encrypting | fcds | Suggestions | 1 | 09-13-2007 01:29 PM |
| how do I make unrouted mail not bounce from my site? | molguin | Shared Hosting Support | 3 | 04-07-2004 11:42 AM |
All times are GMT -5. The time now is 01:49 PM.





, please post it here...




