Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Web Hosting Services

Notices

Reply
 
Thread Tools
  #1  
Old 07-06-2008, 11:40 PM
OneManShow's Avatar
OneManShow OneManShow is offline
Junior Croc
 
Join Date: Jul 2007
Location: http://localhost/
Posts: 143
Unhappy How to make mail form one?

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
Attached Files
File Type: txt test.txt (2.6 KB, 9 views)
File Type: txt send.txt (228 Bytes, 10 views)
__________________
Enjoy Being a HostGator Customer
Reply With Quote
  #2  
Old 07-07-2008, 12:16 AM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: How to make mail form one?

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
Reply With Quote
  #3  
Old 07-07-2008, 05:36 AM
OneManShow's Avatar
OneManShow OneManShow is offline
Junior Croc
 
Join Date: Jul 2007
Location: http://localhost/
Posts: 143
Default Re: How to make mail form one?

Quote:
Originally Posted by slapshotw View Post
Two things:

1. Take the quotes out from around the variables (it should be $name, not "$name", and same for the other $variables).
Did you mean the variables in the mail function?
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:
Originally Posted by slapshotw View Post
2. This won't prevent spam. Anybody can post any information to the form and it will get emailed to you.
That's is what I am talking about, If i put a CAPTCHA in the form, it will work very good alone, and when I add the script for validation email, it will stop working, So, I can't have a form that validate for email and have a CAPTCHA in it.
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
Reply With Quote
  #4  
Old 07-07-2008, 05:03 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: How to make mail form one?

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
Reply With Quote
  #5  
Old 07-08-2008, 01:02 AM
Adorkable Adorkable is offline
Swamp Croc
 
Join Date: May 2008
Posts: 218
Default Re: How to make mail form one?

.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)
Add the following to the send file
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
Reply With Quote
  #6  
Old 07-08-2008, 04:34 PM
OneManShow's Avatar
OneManShow OneManShow is offline
Junior Croc
 
Join Date: Jul 2007
Location: http://localhost/
Posts: 143
Default Re: How to make mail form one?

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
Attached Files
File Type: zip mail.zip (3.5 KB, 1 views)
__________________
Enjoy Being a HostGator Customer
Reply With Quote
  #7  
Old 07-08-2008, 05:41 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,164
Default Re: How to make mail form one?

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
Reply With Quote
  #8  
Old 07-09-2008, 07:20 AM
OneManShow's Avatar
OneManShow OneManShow is offline
Junior Croc
 
Join Date: Jul 2007
Location: http://localhost/
Posts: 143
Default Re: How to make mail form one?

Quote:
Originally Posted by slapshotw View Post
Why aren't you just using a mail script that is already built to work and includes captcha? There must be some out there...
If you know where I can find one , please provide me with the link.
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
Reply With Quote
  #9  
Old 07-09-2008, 08:23 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,093
Default Re: How to make mail form one?

Have a read of this. It might help you out.

http://www.captcha.biz/captchaform/f...d-captcha.html
__________________
- David
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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.