Jump to content

Recommended Posts

I'm currently working out how to best set up a website. I'm going to be setting up a part search system, basically guests to the site will fill in a form for their model of vehicle, these details will then be entered into a database for me to verify before sending the request out to my list of suppliers. The thing is i'm thinking about how to make this secure enough.

 

What i need to know is, if i set up the forms so no bad data can be inserted into the database and make sure the form processing script is using a mysql account that is restricted to inserting data to a specific table in a database, will this be ok? Or is there anything else i need to consider?

 

***Update***

I guess it would also be a good idea to implement something that will stop users submitting multiple data to fill the database. Maybe a bit of code that will restrict access to the form for a set time?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/53633-advice-on-form-processing/
Share on other sites

You may want to consider using this on incoming form data:

 

<?php
function myEscape($string) {
       return  get_magic_quotes_gpc()?addcslashes(stripslashes ($string), "\x00\n\are\\'\"\x1a" ):addcslashes($string, "\x00\n\are\\'\"\x1a" );
}

$make = myEscape($_POST['make']);
?>

 

Just to make sure no SQL Injection happens. Other than that you should be fine.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.