How to find multiple occurance of a string in a target text

How to find multiple occurance of a string in a target  text May be  all of you know the pros and cons of  strpos() function. Why we use this function? Actually sometimes we need to track the position of a search string in a long text or a paragraph. And  so we  use it. echo strpos($targetstring,$searched_string); And it it will  always show the first occurance of the searched text but what we will do when we want to get the multiple occurance. One solution is that we can use the offset as a third parameter for strpos();...

JSF 2.0 and JBoss 4.2.0 Configuration Common Problems and Solutions for Begginers

I almost spent 3 days in creating a new project in Java Server Faces (JFS 2.0 ) in the  JBoss AS 4.2.0 .I made some very small mistakes but atlast after 3 days of hard work i understood the problems and now able to succesfully run a JSF 2.0 project in JBoss AS 4.2 . Problem 1 ERROR [[/MyFirstJSF]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener java.lang.ClassCastException: com.sun.faces.config.WebConfiguration...

How to configure your grub after making a partition in your PC

Sometimes you can not boot in your PC after making a partiton . And you get stuck in a black window at the boot time .This happens because after making the partition in your Hard disk the location of grub from which the OS loads may change . To solve this problem and to boot into your OS follow the next steps : Step 1 . Press “e” (edit) at the start up screen when OS loads . Step 2. In the edit window watch the grub . Let , the grub says  : root(hd0,9) Edit...

How to make Windows your default boot-able OS when dual booting

After installing Ubuntu along with Windows Ubuntu becomes the default boot-able Operating System. However You can make Windows the default boot-able OS . To do this you have to follow the following Commands : Step 1 .Boot with your Ubuntu OS Step 2. Open up a terminal and write : $ cd /boot/grub Step 3. You have to edit the grub.cfg File of this folder.So, give the grub.cfg File write permission by : $ sudo chmod 777 grub.cfg It will ask for your password . Give the...

Very interesting Feature Late Static Bindings(LSB) in php 5.3.0

Very interesting Feature  Late Static Bindings(LSB) in php 5.3.0 Php is now widening its scope and solving its limitation to achieve the pure OOP(Object Oriented Programmng). Now we will learn the LSB by observing the code: <?php class parentclass { public static $c_name = __class__; /*this will store the name of the class in $_cname*/ function get_class_name(){ echo”This is the object of “; return self::$c_name.’<br/>’; } } class subclass1 extends parentclass{public static $c_name = __class__;} class...

How to keep your form with its exact layout By using the Zend Form

How to keep your form with its exact layout By using the  Zend Form Today we will learn how to keep our layout exact like our project main design. We know that if we use Zend form we find some flexibility and advantage for using the component: 1. You can filter and validate the input field. 2. You can group the element or can make the subform. 3. And also you can escape the data prior insert into database so the form filed will be safe from all spam But the bitter experience for most of the developers is that it is tedious to preserve...

How to add recaptcha in Zend Form

How to add recaptcha in Zend Form Its an simple way to add the recaptcha service in your web form. Zend framework reduce your development time by providing the service through its Zend_Service_ReCaptcha. Step-1: You need to signup an account for your domain name or project. Why  you should do this? Because for using the recatcha service you need two key public key and private key. And it will be generated when you will signup in the signup link. Then you will find a signup button.Click the button When...

Secure File and Folder permissions for WordPress

Secure File and Folder permissions for Wordpress File and folder permissions is very important in terms of web security. In most of the cases hackers are some how manage to get the access of your server and can upload/write/ edit your script and compromise your website. Common form of security regarding this is never allow write permissions to group user and public user. In some cases at the time of uploading or activating a plugin you need to change the file permission to even 777, the most vulnerable permission....

Secure your wp-admin folder in WordPress

Secure your wp-admin folder in Wordpress Sometimes you will see that your site has been compromised by hacker. You may have seen that they do it by hacking your wp-admin folder. Your site might be public but you can restrict your wp-admin folder by providing little extra security with a htaccess file. You can limit access to this folder for some IP addresses. Any attempts at accessing any file within this folder will be greeted with a Forbidden error message. You have to create a .htaccess file in your wp-admin...

How to Secure your wordpress site from Hackers

How to Secure your wordpress site from Hackers Several of my websites are hacked today. All of my sites are hosted in Hostgator VPS server and my sites are hacked by “Prishtina Hackers Group”. Thanks to this group who insisted me to seriously thinking about the security of my sites. My sites are hacked that does not means that those hacker group is extraordinary actually as a developer I was less careful about the security of my sites. This is the main offense and security gap from my end. I want to share...
Page 1 of 1712345NextLast »