Here’s how to show the contents of a object in Javascript function concatObject(obj) { str=”; for(prop in obj) { str+=prop + ” value :”+ obj[prop]+”\n”; } return(str); }
Author Archives: kostas
Quotes in mysql queries – security issue
Remember to check numeric data as well. If an application generates a query such as SELECT * FROM table WHERE ID=234 when a user enters the value 234,the user can enter the value 234 OR 1=1 to cause the application to generate the query SELECT * FROM table WHERE ID=234 OR 1=1.As a result, the …
htaccess – friendly url tips
suppose you want example #weeddingplans RewriteRule ^weddingplanners$ shop.php?sub=31&id=7 [L,S] RewriteCond %{REQUEST_URI} /shop.php [NC] RewriteCond %{QUERY_STRING} ^id=7&sub=31 RewriteRule (.*) http://www.wedstar.gr/weddingplanners? [R=301]
friendly url with htaccess
suppose you want /articles.php?cat=$1&art=$2 to become magazine/1/2 then you need these two rules: #articles.php?cat=$1&art=$2 RewriteRule ^magazine/([^/]*)/([^/]*)$ /articles.php?cat=$1&art=$2&marker [L] RewriteCond %{REQUEST_URI} /articles\.php [NC] RewriteCond %{QUERY_STRING} ^cat=(.*)&art=(.*) RewriteCond %{QUERY_STRING} !marker RewriteRule (.*) http://mydomain/%1/%2? [R=301,L]
Setup network interface in linux systems
Κάποιες χρήσιμες εντολές για το σετάρισμα κάρτας δικτύου (π.χ. eth0) σε περιβάλλον linux. View: ifconfig -a (ή eth0) Assign ip address to interface: ifconfig eth0 192.168.1.102 netmask 255.255.255.0 up ifconfig’s syntax and command layout: ifconfig <interface> <ip_address> [ netmask <netmask> ]
Display correctly Greek characters at subject of an email
You can use this function when the subject at an email is not displayed correctly. The idea is to base64_encode the subject header. Something like