Skip to main content

Posts

Showing posts from August, 2015

PHP STRING FUNCTION WITH OUTPUT AND EXAMPLE

PHP STRING FUNCTION  WITH OUTPUT AND EXAMPLE  <?php   $var="my name is saddam hussain saifi ";   print_r(explode("a",$var)); //output:Array ( [0] => my n [1] => me is s [2] => dd [3] => m huss [4] => in s [5] => ifi )       echo crypt($varws);//output:-$1$m5/.1//.$KRawtTgnzzScShDJN3aHa.     echo crc32($var);//output:-1732983884  echo count_chars($var ,4);//output;-!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcgjklopqrtvwxz{|}~€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž ’“”•–—˜™š›œ žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ    echo convert_uuencode($var);//output:-@;7D@;F%M92!I      echo convert_uudecode($var);// output:d4P L@M     echo convert_cyr_string($var,'m','a');       echo chunk_split($var,2,"(sam)");//output:-my(sam) n(sam)am(sam)e (sam)is(sam) s(sam)ad(sam)da(sam)m (sam)hu(sam)ss(sam)ai(sam)n (sam)s...

Minimum and maximum number with - and + 500 in Mysql and Sql query and Find out table scheema of our database in Mysql and sql query and Find out all table name of our database in Mysql and sql query and Find out current date and time in mysql and sql help of sql query

Minimum and maximum number with - and + 500 in Mysql and Sql query:- syntax:-  SELECT MIN(Used)-500 , max(Used)+500 FROM audit Find out current date and time in mysql and sql help of sql query:- syntax:- SELECT now() Find out database name in Mysql and sql query:- syntax:-  SELECT DATABASE(); Find out all table name of our database in Mysql and sql query:- syntax:- SHOW TABLES; Find out   table scheema   of our database in Mysql and sql query:- syntax:- DESCRIBE <table name>;

Secound and third highest number in Mysql and Sql query and Count row of a specific coloumn in table in Mysql and Sql query and Find out minimum value of a specific column in Mysql and sql query and Find out minimum and maximum value of a specific column in Mysql and sql query

Secound and third highest number in Mysql and Sql query:- syntax:- SELECT Budget FROM customer order by budget DESC LIMIT 1,2 Count row of a specific coloumn in table in php syntax:- SELECT COUNT(Used) as a FROM audit Find out minimum value of a specific column in Mysql and sql query:- syntax:- SELECT MIN(Used) as a FROM audit Find out minimum and maximum value of a specific column in Mysql and sql query:- syntax:- SELECT MIN(Used) , max(Used) FROM audit

PHP browser base compiler and online editer script in php

PHP browser base compiler and online editer script in php here you need two file like :- index.php demo.php  index.php  into copy all code and paste it demo.php is blank in same folder    <?php  if(isset($_POST['done']))  {  $file = "demo.php";  $fp = fopen($file, 'w');  $content = $_POST['txt_data'];  fwrite($fp, $content);   fclose($fp);   }  ?> <html>  <head> <script type="text/javascript"> function run() { document.saddam.txt_data.value = document.saddam.txt_html.value;  } </script>   <title>Try It yourself Online Editor</title>   </head>   <body>   <form name="saddam" id="saddam" method="post" action="" >     <table width="100%" cellspacing="0" cellpadding="0" border="1">     <tr >       <td> <input type="submit" name="done" value="run" ...
Form validation html and javascript <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style> .main { height:auto;//100px; width:300px; //border:1px solid #FF0000; } .msg { height:20px; width:200px; //border:1px solid black; color:red; display:none; } </style> <script language="javascript" type="text/javascript"> function hide() { document.getElementById('m').style.display="none"; document.getElementById('m1').style.display="none"; } function check() { var f=document.getElementById('fn').value; var l=document.getElementById('ln').value; if...

Date format in javascript and html by saddam

Date format in javascript and html by saddam  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> D.O.B: <select> <script language="javascript" type="text/javascript"> for(var day=1;day<=31;day++) { document.write("<option>"+day+"</option>"); } </script> </select> <select> <script language="javascript" type="text/javascript"> var month=new Array('jan','Feb','Mar','Apr','Mar','May','Jun','Jul','Aug','Oct','Nov','Dec'); for(var i=0;i<month.length;...

Array in javascript by saddam

Array in javascript  by saddam <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <script language="javascript" type="text/javascript"> var num=new Array(1,2,3,4,5,6,'wahi','mukesh','veerender'); for(i=0;i<num.length;i++) { document.write(num[i] +"<br>"); } </script> </body> </html>

Check input box value in javascript

Check input box value in javascript <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script language="javascript" type="text/javascript"> function check() { var nf=document.getElementById('f').value; var nl=document.getElementById('l').value; alert(nf +" "+nl); document.write(nf +" "+nl); } </script> </head> <body> <form action="" method=""> F. Name:<input type="text" id="f"/><br/> L. Name:<input type="text" id="l"/><br/> <input type="submit" name="sub" id=...

__construct() in php

__construct() in php  <?php class saddam { public $sname; public function __construct( $name )   {   $this->sname=$name;    } public function sanjay ( )   {   echo "sanjay is my friends ";    } }  $myobj=new saddam("sanjay"); ?>

Prime number Program in php by saddam

Prime number Program in php  by saddam   <?php $sam=11; for( $j = 2; $j <= $sum; $j++ ) { for( $k = 2; $k < $j; $k++ ) { if( $j % $k == 0 ) { break; } } if( $k == $j ) echo “Prime no is: “, $j, “<br>”; }  ?> output:- Prime no is:2; Prime no is:3; Prime no is:5; Prime no is:7; Prime no is:11; 

Create new array with the help of arrar()

Create new array with the help of arrar() <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>array in php by saddam</title> </head> <body> Create new array with the help of arrar() <?php $saddam=array("saddam","hussain","saifi","from","ramnagar");  foreach($saddam as $sam)  { echoh $sam."<br>";         }      ?> </body> </html>

Create array element by element

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> Create simple array in php  <?php  // create array element by element  $saddam[0]="saddam";  $saddam[1]="sanjay";  $saddam[2]="hitesh";  $saddam[3]="sanjay";  $saddam[4]="kuldip";  echo "my group friends name is ";  for($i=0;$i<=4;$i++){      echo $i." ". $saddam[$i]."</br>";          }  ?> </body> </html> output should be like this :-  create simple array in php my group friends name is 0 saddam 1 sanjay 2 hitesh 3 sanjay 4 kuldip

ANgular js by saddam basic tutorial

ANgular js  by saddam basic tutorial <!DOCTYPE > <html  ng-app>// create ng-app for angular js area envirment <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Angular js</title> </head> <body> <div class="conteiner"> Enter Name: <input type="password"  ng-model="name"> //here declered ng model as a obect... <ul> <li>{{name}} </ul> </div> <script type="text/javascript" src="angular.js"></script> <!--// angularjs file --> </body> </html>

Extends class in php with multiple object

 Extends class in php with multiple object   <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>oops in php by saddam</title> </head> <body> creat many  object in one class <?php class collage { public $name, $age, $clss,$address; function __construct($n,$a,$c,$ad)     {         $this->name=$n;         $this->age=$a;         $this->clss=$c;         $this->address=$ad;      } } class student extends collage {     function __construct( )     {                 parent::__construct("saddam","15","12","delhi");     }     function index()     {   ...

class in php with __contruct magic function()

Class in php with __contruct magic function()  <html  > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>oops in php by saddam</title> </head> <body> creat many  object in one class <?php class student { public $name, $age, $clss,$address; function __construct($n,$a,$c,$ad) {     $this->name=$n;     $this->age=$a;     $this->clss=$c;     $this->address=$ad;  }      }     echo "</br>";     $obj1=new student('saddam','17','15','delhi');   echo $obj1->name ."</br>";   $obj2=new student('sanjay','17','15','rudarpur');   echo $obj2->name ."</br>";   $obj3=new student('hitesh','17','15','darghat');   echo $obj3->name ."</br>";   $obj4=new student('vikass','17','15','delhi');   ec...

oops in php by saddam saifi

oops in php by saddam saifi here is simple structure of class <?php class saddam { } ?>  create object with the use of new word <?php class saddam { } $sam=new saddam;   ?> declareb variable in class <?php class saddam { public $var1="saddam"; public $var2="saifi"; } $sam=new saddam;   ?> use function and method in class <?php class saddam { public $var1="saddam"; public $var2="saifi"; function saifiji() { echo "hello world"; } } $sam=new saddam;   $sam->saifiji(); ?> output:- hello world

log in system in php and html

Log in system in php and html step1 :- create a form for user information used to store <form action="" metho="post"> <table>  <tr><td>Name </td> <td><input type='text' name='name'> </td> </tr> <tr><td>Email </td> <td><input type='text' name='email'> </td> </tr> <tr><td>Address </td> <td><input type='text' name='address'> </td> </tr> <tr><td colspan='2'><input type="submit"  value="submit" > </td> </tr> </table> </form> step2:- php code top of the page     if(isset($_REQUEST['submit'])) {   $name=$_REQUEST['name']; $email=$_REQUEST['email']; $address=$_REQUEST['address']; //validation in php if(!empty($name)) { if(!empty($email)) { if(filter_var($email , FIL...

Mysql join query in mysql and php

Mysql join query in mysql and php <?php $sql="select id ,name , address, city  from  table1  , table2  where table1.id=table2.cusid "; ?> inner join <?php $sql="select id ,name , address, city  from table1 INNER JOIN table2 ON table1.id=table2.cusid "; ?> left join <?php $sql="select id ,name , address, city  from table1 LEFT JOIN table2 ON table1.id=table2.cusid "; ?> right join <?php $sql="select id ,name , address, city  from table1 RIGHT JOIN table2 on table1.id=table2.cusid "; ?> full join <?php $sql="select id ,name , address, city  from table1 FULL JOIN table2 on table1.id=table2.cusid "; ?>

Mysql like function in mysql and php

Mysql like function in mysql and php <?php $sql="select * from 'your table name ' where name LIKE '%saifi%'"; ?> or <?php $sql="select * from 'your table name ' where name LIKE '_saifi%'"; ?> or <?php $sql="select * from 'your table name ' where name LIKE 'sai_'"; ?> or <?php $sql="select * from 'your table name ' where name LIKE '_fi'"; ?>

Update query in mysql and php

Update query in mysql and php update query with where  condition. <?php $sql="update 'your table name ' set   column1='value',column2='value' where name ='saddam'"; ?> update query with multi where  condition. <?php $sql="update 'your table name ' set   column1='value',column2='value' where name ='saddam' and city='delhi' "; ?>

delete query in mysql and php used

Delete query in mysql and php used   Delete single row query  with where condition <?php   $sql="delete from 'your table name ' where id ='4'"; ?>     Delete single row query  with multiple where condition <?php   $sql="delete from 'your table name ' where name ='sam' and city='delhi' and gender='male' "; ?>    

Mysql select query with order by ASC and DESC

Mysql  select query  with order by ASC and DESC mysql use two type of order: 1 ascending ASC 2 decending DESC  ASCENDING ORDER <?php $sql="select * from 'your table name ' order by id  ASC "; mysql_query($con,$sql); ?> DECENDING ORDER <?php $sql="select * from 'your table name ' order by id DESC  "; mysql_query($con,$sql); ?>