Ganesh H S

Thoughts on open source technologies, search engine optimization, website security

Porting PHP to Javascript : php js

During graduation got interested in web technology, to kick start i started reading html, javascript.
But when i started my career i was bit disappointed when i realised javascript won’t work if the javascript is disabled in the browser, so my senior in first company suggested me to always do server side validation using php.
But […]

PHP: Easier way to set the include_path

I always used retrieving the Operating system environment, and then get all current include path and then set the include path
<?php

$delim = (PHP_OS == “WIN32″ || PHP_OS == “WINNT”) ? ‘;’: ‘:’;

ini_set(’include_path’, “.”);
ini_set(’include_path’, ini_get(’include_path’) . “my_library”);
ini_set(’include_path’, ini_get(’include_path’) . “my_library/include”);

?>
Here is the code, which simplifies the above logic of detecting OS environment and then to get […]

PHP: Configuring project environment using ini file.

Whenever we move the project from localhost to development or production, changing the environment paths, database server name, databaseuser name, database password , is a tedious process and i always got bugged. We are over cautious of over writing the environment variables. Here is a quick fix for that.
Lets write a configuration file( […]