Sunday, 5 May 2013

Abstract Class Example


abstract class One{

public function disp(){

echo "Inside the parent class
";

}

}

class Two extends One{

public function disp(){

echo "Inside the child class
";

}

}

class Three extends One{

//no method is declared

}

$two=new Two();

echo "Calling from the child class Two:
";

$two->disp();

echo "Calling from the child class Three:
";

$three=new Three();

$three->disp();

?>

Monday, 1 April 2013

https://docs.google.com/forms/d/1zVa4KFmjzvYFhUhUGVeZFlGUmC9lxrtyvbUDg7_z-i8/viewform?pli=1



For Email the page help:-

most help full :- http://www.html-form-guide.com/contact-form/php-email-contact-form.html

http://thedemosite.co.uk/phpformmailer/source_code_php_form_mailer_more_secure_than_cgi_form_mailers.php


Saturday, 23 March 2013

how to get the last inserted id in sql query

retrieves the ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).
use the function mysql_insert_id()

Que.Warning: Cannot modify header information - headers already sent by.

Ans.use the function
ob_start() after where u start the session_start()

Thursday, 21 February 2013

str replace for replacing str

<?php
$arr = array("ram","shyam","sita","gita");
print_r(str_replace("shyam","ramesh",$arr,$i));
echo "Replacements: $i";
?>
The output of the code above will be:
Array
(
[0] =>ram
[1] =>ramesh
[2] =>sita
[3] =>gita
)
Replacements: 1

Sunday, 3 February 2013

PHP - Multidimensional Arrays

PHP - Multidimensional Arrays

A multidimensional array is an array containing one or more arrays.
In a multidimensional array, each element in the main array can also be an array. And each element in the sub-array can be an array, and so on.

Example

In this example we create a multidimensional array, with automatically assigned ID keys:
$families = array
  (
  "Sharma"=>array
  (
  "Rahul",
  "Aman",
  "Saurav"
  ),
  "Singh"=>array
  (
  "Manu"
  ),
  "Saxena"=>array
  (
  "Ram",
  "Shyam",
  "Ramesh"
  )
  );
The array above would look like this if written to the output:
Array
(
[Sharma] => Array
  (
  [0] => Rahul
   [1] => Aman
   [2] => Saurav
  )
[Singh] => Array
  (
  [0] => Manu
   )
[Saxena] => Array
  (
  [0] => Ram
   [1] => Shyam
  [2] => Ramesh
  )
)

Tuesday, 29 January 2013

why md5 is used for?and how it is used?

The md5() function uses the RSA Data Security, Inc. MD5 Message-Digest Algorithm.

<?php
$str = "Hello";
echo md5($str);
?>

output
8b1a9953c4611296a827abf8c47804d7