database - Security and php -


so have website given users input generate /home/content/s/a/m/p/l/e/users/profile/index.php. real question is, safe? try sanitize users input, if there more, please let me know.

strip_tags(html_entity_decode($mysqli->real_escape_string($title)), allowed_tags); allowed_tags = "<br><p><b><i><hr>"; 

since relatively new website development, wondering if approach, because takes strain off using database same information on , on again, instead have static page information on it, or huge security hole? not know! :) not know if sort of xss attack have setup here. please help!



michael

p.s. if have answers or suggestions, please give me insight why is. have degree in computer science curious on how works, not quick , dirty solution. thanks.

this php security checklist compiled company's internal knowledgebase. may helps.

  • do not use deprecated functions , practices
  • always validate user input
  • use place holders when using variable values in sql query.
  • always escape variables used in sql queries.
  • set proper directory permissions
  • always regenerate session id when user logs in each time. (to avoid session id hijacking)
  • never store passwords in plain text. store hashed values.
  • when outputting user input in web page, check html special characters. (html tags may used xss attacks)
  • know specs of deployment server before move it
  • protect directories log entries saved.
  • set register_globals off
  • php safe mode can useful, deprecated since version 5.3
  • if not used in code, disable functions system , exec using disable_functions setting in php.ini
  • set display_errors off in production/live servers.
  • validate cookie data

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -