Hi friends it was a long break, Sorry for the delay from my side i was little busy with my personal matters. Here we are going to registration page last day we were discussed about GET,POST etc things today we are beginning with the same line. The first word of that line ‘isset’

isset() is a function in php its is used for checking a variable is set or not. It is commonly used in in condition. The example below explains it working.

$var = '';
if (isset($var)) {
    echo "Variable '$var' is set with the value NULL so this line will be executed.";
unset ($var);
if (isset($var)) {
    echo "Variable '$var' is unset above so this statement will not be executed.";

Hope it is now clear for you. and now we can move to next line in the registration page of our project. Consider the line 5 to 11 here we are collecting the values of each variable posted with corresponding variable names. Consider line 5 for more details

$name       =    mysql_real_escape_string($_POST['txtname']);

Hope you all heard about SQL injection i’ll explain what is SQL injection latter. Now just understand that it is a hacking process. The function MySQL_real_escape_string() adds an escape character, the backslash, ‘\’, before certain potentially dangerous characters in a string passed in to the function. The characters escaped are…

  • \x00
  • \n
  • \r
  • \
  • \x1a

In short if there is any characters specified above present in the value ‘$_POST[‘txtname’]’,the function will append a back slash(‘\’)with that character and saved it in to the variable ‘$name’

All the remaining lines are executed in like this and will be save in the corresponding variables.The variable ‘$_POST[‘txtname’]’ as I explained before $_POST is a supper global array and the address txtname will have a value. ‘txtname’ is the name of the controller in the registration page.

This is enough for today and the remaining portions will be explained in next article.

Be Sociable, Share!

Leave a Reply

Your email address will not be published. Required fields are marked *

− 1 = 1