Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 6th May 2014, 09:13 PM   #1
www.deeptenger.com
Registered Member
 
Joe Ray's Avatar
 
Join Date: 2013
Posts: 518
Thanks: 211
Thanked 91 Times in 77 Posts
Blog Entries: 1
Default
PHP email submit backend question
Share on: 
fb share twitter share gplus share more share

I am creating a squeeze page for myself using html5/css.

I don't know php but I am using a short php script I put together from what I found on the net just for the email submission/sign-up form back end.

It works fine but I want to make sure there is no security issues with this code.
How can I check this php code for possible security problems? Or, I don't have to worry about this?
Joe Ray is offline  
Unread 7th May 2014, 12:41 AM   #2
Warrior Member
 
Join Date: 2014
Posts: 5
Thanks: 0
Thanked 3 Times in 2 Posts
Default
Re: PHP email submit backend question
Share on: 
fb share twitter share gplus share more share

As long as the email is only going to you, and that address is hard coded, you don't have too much to worry about.

It's also really good idea to make sure the permissions on the file are set to 644.
InsolentCat is offline  
Unread 7th May 2014, 12:44 AM   #3
HyperActive Warrior
War Room Member
 
Join Date: 2002
Location: United States
Posts: 421
Thanks: 22
Thanked 98 Times in 74 Posts
Default
Re: PHP email submit backend question
Share on: 
fb share twitter share gplus share more share

Post the code and see if someone can give you some pointers. There are quite a few form validation and email sending scripts, libraries and tutorials out there.

Youtube has plenty of videos on these as well and how to write your own, what to look out for etc.

The main thing is if it will be using a database, there are special things you need to do to protect the database if so. Also preventing someone from hijacking your script and sending out spam from it. Which you would be legally and financially liable for even though you personally didn't send the spam, but since it was sent from your hosting account and website you would be the liable party anyway.

Validate ALL input.
Prevent someone from sending emails via the script.

Those are the main things but not all. If you are not using a database it will be much easier to secure and many exploits won't necessarily need to be addressed in your script as you would if you were using a database.

Post the code and someone can take a look and give suggestions OR just use one of the many premade frameworks out there to do it for you. If you are using wordpress you can install plugins that will do all that for you without you needing to do anything with programming yourself.
Terry Crim is offline  
The Following User Says Thank You to Terry Crim For This Useful Post:
Unread 7th May 2014, 03:15 AM   #4
www.deeptenger.com
Registered Member
 
Joe Ray's Avatar
 
Join Date: 2013
Posts: 518
Thanks: 211
Thanked 91 Times in 77 Posts
Blog Entries: 1
Default
Re: PHP email submit backend question
Share on: 
fb share twitter share gplus share more share

Originally Posted by Terry Crim View Post


The main thing is if it will be using a database, there are special things you need to do to protect the database if so. Also preventing someone from hijacking your script and sending out spam from it. Which you would be legally and financially liable for even though you personally didn't send the spam, but since it was sent from your hosting account and website you would be the liable party anyway.
This is exactly what I am concerned about. Thanks very much Terry!

I am not using WP, I am learning to code and creating my first site that I am writing from scratch.

Basically, its just a small site with 3 pages. I just placed the php script in the site folder and the script is sending the submitted email address to the auto responder in my hosting package. I guess this could make it vulnerable to an attack? I am not sure.

You think I should really just copy and post the code here in the forum?
Joe Ray is offline  
Unread 7th May 2014, 07:42 AM   #5
Server Problem Smasher
 
jeffatrackaid's Avatar
 
Join Date: 2010
Location: Jacksonville, FL
Posts: 46
Thanks: 0
Thanked 18 Times in 17 Posts
Default
Re: PHP email submit backend question
Share on: 
fb share twitter share gplus share more share

I would check out:
Free PHP Form script : Form to Email processor : Process web contact forms

Depending on how your script is coded, you could have security issues relating to spam, cross site scripting or other issues.

Bots regularly scan for forms like this and attempt to probe them for weaknesses.

Server support services for small businesses. Remember, Faster sites sell more.
jeffatrackaid is offline  
Unread 7th May 2014, 10:06 PM   #6
www.deeptenger.com
Registered Member
 
Joe Ray's Avatar
 
Join Date: 2013
Posts: 518
Thanks: 211
Thanked 91 Times in 77 Posts
Blog Entries: 1
Default
Re: PHP email submit backend question
Share on: 
fb share twitter share gplus share more share

The more I am looking into this, the more complicated it seems. I still haven't figured out if my code is secure but now I think its probably not.

There must be an easy way to secure this php code, but I don't know enough php to even have any idea how to do it.

I still would appreciate some help with this.
Joe Ray is offline  
Unread 16th May 2014, 11:46 AM   #7
Warrior Member
 
Nick1SEO's Avatar
 
Join Date: 2014
Location: Philadelphia, PA
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: PHP email submit backend question
Share on: 
fb share twitter share gplus share more share

Try to use SMTP over the PHP Mail function, you'll get better results on a contact form.
Nick1SEO is offline  
Closed Thread


Bookmarks

Tags
backend, email, php, question, submit


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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 07:22 AM.