IT.COM

Simple Contact Form (UPDATED)

Spaceship Spaceship
Watch
This is an update of my Simple Contact Form script that I posted here which is very old and has many vulnerabilities.

(all functions pulled from my Domain Name Portfolio script ;) )

Current Version: 1.0.7 (July 25, 2008)

Changelog:
1.0.7
-Removed option for HTML email
-Script now uses a config file 'sc_config.php' in 'sc_includes'
-There are other changes, but I can't recall everything.
-Cleaned up code and HTML

1.0.6
-Replaced current captcha with a whole new class and fonts
-Added a captcha image refresh
-Added new email headers
-Cleaned up code

1.0.5
-New constant, USE_HTML - if set to false, HTML won't be used for email.
-Added a new font "Acens.ttf" and removed one.
-New function to determine if the server has GD and freetype support.
-JS validation added to contact form (just checks if fields are empty atm)
-Overall code cleanup.

1.0.4
-New constant, USE_CAPTCHA - if set to false, CAPTCHA won't be used.
-Overall code cleanup.

1.0.3
-New constant, SPAM_NUM_LINKS, for the is_spam function.
-Added CAPTCHA (requires GD2 w/FreeType)

1.0.2
-Improved functions + the new 'is_spam' function
-New email headers (taken from phpBB's emailer class, and modified a tad)

1.0.1
-Functions file, with several functions to properly 'sanitize' input.
-Better error handling, and email validation regex
-Licensed under the GNU GPL

Attached (or you can download here: http://code.google.com/p/simple-contact-form/ ). Let me know if you have any problems.
 

Attachments

  • simple_contact_form.zip
    40.2 KB · Views: 381
Last edited:
2
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
If you are using PHP, you can do this:

PHP:
<?php include 'file.html'; ?>
 
0
•••
Sorry about thsi, but I have another problem. For other reasons, I've decided to change all the pages in my site to .php, not .html as they were before. But now something has happened to my contact page. Before, I used an iframe for the contact form, but as its now .php, I don't need to do this.

See:
http://www.biospherical.net/contact.php

You'll see:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/biospher/public_html/contact.php:8) in /home/biospher/public_html/contact.php on line 33

Anyone know what the problem is?

Thanks in advance!!
 
0
•••
session_start(); has to be the very first code on the page, after <?php

If you've just used a php include to include the contact form on another page, you need to move the session_start(); code out of contact.php, and to the top of the other file instead.
 
0
•••
0
•••
0
•••
I tried downloading this, but the download doesn't seem to work.
 
0
•••
It is a nice script... When I was beginner, I always had problems with PHP formularys =P
Anyways, does this formulary accepts HTML formatation?
 
0
•••
I'm not sure what's going on with attachments.. can't seem to find it on my HD either.. I'll see what I can come up with.

@Flaepru - it strips all HTML from input, if that's what you're asking.
 
0
•••
SecondVersion said:
I'm not sure what's going on with attachments.. can't seem to find it on my HD either.. I'll see what I can come up with.
I found a copy on my computer - download here.

I made the quick fix that I mentioned in post #21 too. :tu:
 
0
•••
Can you send a zip of yr Simple Contact Form as it won't download.

Thks

[email protected]
 
0
•••
does anyone know how to make this script run with a validation images, to stop robots sending endless email?
 
0
•••
0
•••
Updated to 1.0.4, see the 1st post.

Note: hasn't been tested, been quite busy but threw a release together ;) If you have any problems, just post here.


-Eric
 
0
•••
this image verification thing is not a good idea.

previous version of script was better.

please post older version if somebody have that
 
0
•••
vivsin said:
this image verification thing is not a good idea.
:?

EDIT:
Updated to 1.0.5, see first post.
 
Last edited:
0
•••
1.0.4
-New constant, USE_CAPTCHA - if set to false, CAPTCHA won't be used.
-Overall code cleanup.

I missed this part.



One more good idea can be Email Retype field, 30% of my visitors mistype there email address.
 
0
•••
0
•••
I'm going to be updating this script, but I'd like to know if any of you have features you want me to add.

--
And

Sorry, never noticed your post fried-chicken - It's off to the left for me?
 
0
•••
0
•••
0
•••
Downloaded it. :)

Thanks a lot SV.
Joe
 
0
•••
Just what I was looking for. :)
 
0
•••
Anyone have a copy of the latest version? The attachment no longer works. This time I thought I had saved a copy on my PC, but I can't find it.
 
0
•••
SecondVersion: The attachment no longer works (as you're already aware). Did you manage to find a copy?
 
0
•••
Was never able to find a copy. If no one has a copy, I may have to rewrite, IF I can ever find the time to do so.
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back