Monthly Archives: December 2010

How to prevent XSS attacks through php?

There are a number of ways hackers put to use for XSS attacks, PHP’s built-in functions do not respond to all sorts of XSS attacks. Hence, functions such as strip_tags, filter_var, mysql_real_escape_string, htmlentities, htmlspecialchars, etc do not protect us 100%. You need a better mechanism, here is what is solution:


MYSQL data manipulation language (DML) commands?

Data Manipulation Language

Data Manipulation Language (DML) statements are used for managing data within tables. Some commands of DML are:


MYSQL data definition language (DDL) commands?

Data Definition Language (DDL)

DDL statements are used to define and modify the database structure of your tables or schema. When you execute a DDL statement, it takes effect immediately.
Some commands of DDL are:


How to backup and restore a MySQL database?

You can use mysqldump to create a simple backup of your database using the following syntax.


How to run perl in MAMP?

If everything is configured properly, put a perl file in your cgi-bin folder, set permissions so that apache can execute it, and you are all set ready to go.

Basically, Perl suffers in this aspect just because it was first and that is the way CGIs were done. PHP came along and the default setting allowed PHP scripts to run from any directory. So this is a little trouble for php programmers.

It took one hour for me to figure out how to run perl in MAMP.

Well here are some easy steps for you.

The permissions for all of those files needs to be 755.