How to fix ‘Function eregi() is deprecated’ in PHP 5.3.0

Published on

Problem or the issue: Previously eregi used to validate email address input using regular expression. That would return true if given email address matches to username@domain.ext pattern. Unfortunately, after upgrading PHP to the new version (5.3.0), it won’t work properly and throw notices. This is because eregi is one of several functions that are deprecated in the new version … Continue reading How to fix ‘Function eregi() is deprecated’ in PHP 5.3.0

What are the deprecated functions in PHP 5.3.0

Published on

The list of functions that are deprecated in PHP 5.3.0: call_user_method() (alternative: call_user_func() ) call_user_method_array() (alternative: call_user_func_array() ) define_syslog_variables() dl() ereg() (alternative: preg_match() ) ereg_replace() (alternative: preg_replace() ) eregi() (alternative: preg_match() with the ‘i’ modifier ) eregi_replace() (alternative: preg_replace() with the ‘i’ modifier ) set_magic_quotes_runtime() and its alias, magic_quotes_runtime() session_register() (alternative: the $_SESSION superglobal ) … Continue reading What are the deprecated functions in PHP 5.3.0

How to fix “Cannot load mysqli extension. Please check your PHP configuration” phpMyAdmin Error.

Published on

– Solution – This usually occurs when more than one MySQL versions are being used and that too when switching b/w them. step 1:  open php.ini and search for ‘extension_dir’ and check whether the files and folders exist in the given path and the right version number folder. extension_dir = “c:/wamp/bin/php/php<version number>/ext/” if you have made any changes, then restart … Continue reading How to fix “Cannot load mysqli extension. Please check your PHP configuration” phpMyAdmin Error.

How to configure Php with Http

Published on

PHP with HTTP2 on Linux. # yum install bzip* # yum install libjpeg-devel # yum install libpng* # yum install gmp-devel* # yum install ncurses-devel* # yum install pspell-devel # yum install curl* # yum install gcc* # yum install libxml2* # yum install gdbm* Download this package or latest. # wget http://apache.mirrors.tds.net/httpd/httpd-2.2.10.tar.gz # wget … Continue reading How to configure Php with Http

How to configure PHP 5 on Centos

Published on

1. Edit CentOS-Base.repo 2. Enable CentOSPlus by changing: #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever – Plus mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 to: #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever – Plus mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 3. Run yum yum install php – to freshly install PHP5 Or … Continue reading How to configure PHP 5 on Centos

How to pass value from javascript to java?

Published on

Transferring the values between javascript and java can be done using the follow example 1)Pass value from jsp scriplet to javascript: <% String str=”Hello World”; %> <html> <head> <script language=”javascript”> function access(){ var s=”<%=str%>”; alert(s); } </script> </head> <body onload=”access()”> </body> </html> 2)Pass value from javascript to Jsp scriplet: <script> function get(){ var m=”Hello”; window.location.replace(“h.jsp?mess=”+m); … Continue reading How to pass value from javascript to java?

How to create password protected zip file using java

Published on

In java,We can create zip file but cannt set password using java.util.zip library We should use external library to create password protecting zip files. The list of available external libraries are http://www.lingala.net/zip4j/ http://www.chilkatsoft.com/java.asp http://code.google.com/p/winzipaes/ merkert.de/de/info/zipaes/src.zip