February 5th, 2010
Sometimes we transfer php scripts from one Linux system to another Linux system with the help of a pen drive. In that case the permission of php scripts is automatically changed to 755 which is wrong. On a Linux system the permission of php scripts should be 644 for its proper execution. So in order to set the permission of php scripts to 644 recursively in all directories, we should execute the following command:
find -iname ‘*.php’ -exec chmod 644 ‘{}’ \;
Best Regards …
Pankaj Kumar
Posted in Linux | No Comments »
January 28th, 2010
Hi all,
After a long time interval I am going a place a new post in my blog. It is about the eval function of PHP. Here is an example of simple use of this function.
First of all please make a file named template.html whose content is as follows:
$page=
”
Hello $msg
“;
Clearly in this file we are assigning some value to the variable $page. This value will depend upon the value of variable $msg. When this string will be evaluated as PHP code then a new variable will be defined whose name will be $page. And before defining it we can set the value of the variable $msg as per our requirement.
So now create a file eval.php whose content is as follows:
$msg=”PHP”;
$str=file_get_contents(”template.html”);
eval($str);
echo $page.”\n”;
Clearly when this code will be evaluated then the value of variable $page will become equal to Hello PHP as the value of $msg has been set to PHP. So the output of this program will be the string “Hello PHP”.
The main benefit of writing this type of code is that the pure HTML code is stored in one file and PHP code is stored in another file. So whenever we have to change the design then we have to simply change the HTML code in one file. There will be no need to make any change in PHP script.
I hope that my explanation about usages of eval function will help someone.
Best Regards …
Pankaj Kumar
Posted in Linux | No Comments »
August 23rd, 2009
Recently in one of the project our aim was to display an avi video on the home page and make it link so that after clicking this video the control should go to the next page. We tried several experiment with the embed and object tag but the video was not being displayed as link. Finally using the <img> tag in the following manner the video was displayed as link:
<div onclick=”location.href=’next_page.php’;” style=”cursor:hand;”>
<img dynsrc=”video.avi” loop=”infinite”>
</div>
I hope that this code will help to someone else who want to play avi video as a link in the browser Internet Explorer.
Best Regards …
Pankaj Kumar
Posted in Uncategorized | No Comments »
January 19th, 2009
Hi all,
When we create ftp account on cpanel then the format of username becomes user@domain.name. So now when we try to login to this ftp account with the following URL:
ftp://user@domain.name:password@domain.com
then it fails as there are two instance of the symbol @ in this URL. So in this case we should replace the first occurance of the @ with %40 so that the URL becomes:
ftp://user%40domain.name:password@domain.com
So with the help of this URL we can login to ftp account using a browser such as konqueror.
Best Regards …
Pankaj Kumar
Posted in Linux | 9 Comments »
January 19th, 2009
The rpm file for suse 10.1 can be downloaded from the URL http://ftp.skynet.be/pub/packman/suse/10.1/i586/. This URL also contains lot of other rpm files for suse linux 10.1.
Best Regards …
Pankaj Kumar
Posted in Linux | 2 Comments »
January 19th, 2009
Here is the URL of yet another zenwalk linux repository from where packages of zenwalk linux can be downloaded:
http://zur.zenwalk.org/view/packages/
From this repository we can even download kdewebdev package with the help of which Quanta Plus IDE can be installed on zenwalk linux.
Pankaj Kumar
Posted in Linux | No Comments »
December 7th, 2008
Hi all,
Today I discovered the fact that in Quanta Plus IDE, the auto completion feature for PHP function name can be acheived by pressing Ctrl+Shift key combination after writing first few characters of function. So there is no chance of making error while writing PHP function names in Quanta Plus IDE. However we can also customize this IDE in such a way that the autocompletion of PHP function name can be done by pressing Tab key similar to the fact that linux command names are auto completed in terminal by pressing Tab key. To do this please click on Settings Menu and then click on “Configure Shortcuts”. Then click on the Action “Complete Text”. Then select Custom and then set Tab key as the shortcut key of this action. So after this the name of PHP functions will be autocompleted by pressing first few characters and then pressing Tab key.
Best Regards …
Pankaj Kumar
Posted in Linux | 5 Comments »
December 7th, 2008
Hi all,
If a zenwalk linux system is working as a client system in a LAN and the Internet is available to this system via squid (or any other proxy server) then the netpkg command will not work from the terminal of zenwalk system. So in order to make netpkg system functioning in such system we have make entry of proxy servers in the file /etc/wgetrc. We need to set the values of variables http_proxy and ftp_proxy in the file /etc/wgetrc. Then we can install extra package from Internet on such zenwalk linux system.
Best Regards …
Pankaj Kumar
Posted in Linux | No Comments »
December 4th, 2008
Hi all,
Today I have searched the repository of LAMP packages for zenwalk linux. LAMP packages can be downloaded from the URL http://mirror3.mirrors.tds.net/pub/linux/zenwalk-current/current/s/ for zenwalk linux.
And here are important reference on how to install these packages:
http://manual.zenwalk.pl/ch04s03.html
http://wiki.zenwalk.org/index.php?title=Zenwalk_Package_Rules
http://support.zenwalk.org/viewtopic.php?f=46&t=12382&p=77876
I think this will help some zenwalk linux addict.
Best Regards …
Pankaj Kumar
Posted in Linux | No Comments »
December 1st, 2008
Hi all,
Sometimes when the MS Windows is affected by virus then by creating a new php script by dreamweaver inserts the reference to the URL http://ww.viph.net/wuhan/down.htm in the last line of each php script. In order to remove such refererence from such files we need to execute a single linux command. You can view this linux command at http://www.glug4muz.org/command.txt.
Best Regards …
Pankaj Kumar
Posted in Linux | No Comments »