PHP Warning: mysql_query(): Access denied for user 'vhelpf'@'localhost' (using password: NO) in ..../includes/class_postbit.php(265) : eval()'d code on line 2

PHP Warning: mysql_query(): A link to the server could not be established in ..../includes/class_postbit.php(265) : eval()'d code on line 2

PHP Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in ..../includes/class_postbit.php(265) : eval()'d code on line 3

PHP Warning: mysql_query(): Access denied for user 'vhelpf'@'localhost' (using password: NO) in ..../includes/class_postbit.php(265) : eval()'d code on line 2

PHP Warning: mysql_query(): A link to the server could not be established in ..../includes/class_postbit.php(265) : eval()'d code on line 2

PHP Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in ..../includes/class_postbit.php(265) : eval()'d code on line 3
php XSS countermeasures - Vista Help Forum

Go Back   Vista Help Forum » Web Design & Development » Programming
Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2007
cpearson's Avatar
cpearson cpearson is offline
Agent - Level 3
 
Join Date: Dec 2006
Posts: 281
cpearson is on a distinguished road
Default php XSS countermeasures

If you write php code you are (or should be) aware of cross site scripting attacks and how vulnerable form processing can be. What countermeasures do you use. Post your functions (or links to) in this thread. I will kick it off with a a function I use regularly.

http://quickwired.com/smallprojects/...r_function.php

.

Reply With Quote
  #2  
Old 11-13-2007
cpearson's Avatar
cpearson cpearson is offline
Agent - Level 3
 
Join Date: Dec 2006
Posts: 281
cpearson is on a distinguished road
Default php remove non alphanumeric characters

Here is a quick way to remove non alphanumeric chars. from a string.


Code:
$var = preg_replace('/[^0-9a-zA-Z]/', '', $var);
[0-9a-zA-Z] means any character that is alphanumeric
[^0-9a-zA-Z] means any character that is NOT alphanumeric
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP rss parser class awesomo Programming 3 06-11-2015 03:53 PM
What Is Harder, JavaScript Or PHP? LiberMan Programming 1 02-01-2012 02:37 AM
GD Library PHP Tutorial cpearson Programming 2 11-17-2007 12:09 PM