PHP Warning: Cannot modify header information – headers already sent

PHP Warning: Cannot modify header information – headers already sent – It is caused due to Functions that send/modify HTTP headers must be invoked before any output is made. Otherwise the call fails: Warning: Cannot modify header information – headers already sent (output started at script:Line Number) Reason: HTTP HEADERS are very sensitive. The function […]

mysql_fetch_assoc() expects parameter 1 to be resource, provided boolean: Reason and Solution

Mysql_fetch_assoc() expects parameter 1 to be resource but boolean is provided can be caused due to various reason. We have to analyse the code and hand the issue accordingly. NOTE: The mysql_ functions are deprecated and have been removed in php version 7. So we are going to use mysqli_function Reason: If we are using […]

Fifteen easy solutions to identify, handle and parse PHP Syntax Errors efficiently

One of the annoying problem most web developers encounter is PHP Syntax Errors. What are PHP Syntax Errors? PHP syntax errors are the errors that is caused due to implementation of wrong syntax in the PHP Script. PHP is a server side scripting language. Therefore, we have to careful while using this scripting language in […]

Solution to PHP Notice: undefined index or Undefined offset

One of the PHP Notice that we can notice while running PHP Script is Undefined Index or Undefined Offset. Why PHP Shows the notice – Undefined index or Undefined offset? Index or offset is associated with array in PHP. If an array variable does not contain key value or the array value is null or […]

What is Notice: Undefined variable in PHP and Solution?

The biggest challenge in front of web developer is to run PHP scripts without any errors and warnings. PHP: Notice undefined variable is the one of the warning, we encounter. Why warning or notice, ‘Undefined variable’ rises? As the warning or notice says, undefined variable, the variable is not defined and we are trying to […]

Simple tricks to prevent SQL Injection using PHP

SQL Injection is one of the biggest threat most website developer are worried for. There are various solutions available. But there are no 100% sure shot solution to prevent SQL Injection. What is SQL Injection? A way to inject SQL queries in to the server. This injection can be done through input fields such as […]

Random Password Generator using Javascript

In certain case we may want to provide a feature to the website user to generate a password. There are lots of options available to generate a password for user. But in this article, we are going to focus on how to generate a random password using javascript. Before proceeding further, we have to figure […]

Javascript For loop

For loop in Javascript helps us to execute a task in a loop. Example: Lets print 1 to 5, var a=1; alert(a); a=2; alert(a); a=3; alert(a); a=4; alert(a); a=5; alert(a); The above code would print 1 to 5. Problem with above approach: In the above approach, we have declared one variable a and we have […]

Assignment Operators in Javascript

Javascript Comparison operators is used to perform comparison operations. There are various types of comparison operators available to perform various types of comparison. Lets discuss in detail. Equal Operator(==) Equal operator (==) is used to compare two values, and if both values are same, then it returns true otherwise it returns false. Example:   var […]

Decrement operator in Javascript

Javascript provides decrement operation. To perform decrement operation we use decrement operator. Decrement operators are helpful in lots of situation. Suppose we have allowed user to perform a task for a limited number of times. By using decrement operator, we can track how many attempts left for the user to perform the task. We use […]