| | #1 |
| www.deeptenger.com Registered Member |
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? |
| |
| | #2 |
| Warrior Member Join Date: 2014
Posts: 5
Thanks: 0
Thanked 3 Times in 2 Posts
|
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. |
| |
| | #3 |
| HyperActive Warrior War Room Member Join Date: 2002 Location: United States
Posts: 421
Thanks: 22
Thanked 98 Times in 74 Posts
|
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. |
| |
| The Following User Says Thank You to Terry Crim For This Useful Post: |
| | #4 | |
| www.deeptenger.com Registered Member |
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? | |
| |
| | #5 |
| Server Problem Smasher Join Date: 2010 Location: Jacksonville, FL
Posts: 46
Thanks: 0
Thanked 18 Times in 17 Posts
|
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.
| |
| |
| | #6 |
| www.deeptenger.com Registered Member |
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. |
| |
| | #7 |
| Warrior Member Join Date: 2014 Location: Philadelphia, PA
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
Try to use SMTP over the PHP Mail function, you'll get better results on a contact form.
|
| |
|
| Bookmarks |
| Tags |
| backend, email, php, question, submit |
| |