Skip to main content

Posts

Showing posts from July, 2016

how to use mail function in php | mail in php | mail code in php | mail script in php

how to use mail function in php | mail in php | mail code in php | mail script in php  <?php $to  = 'saddam1234321@gmail.com'; $subject = 'test mail'; $message = 'this is dummy mail'; //mail(to, subject, message, header, variable) mail($to, $subject, $message); ?>   1 To is reciver email adress 2 subject is short text 3 message is brief dicustion  

how to use session in php | session sart in php | Session | php

how to use session in php | session sart in php <?php php session_start(); ?> <html> <?php $var="saddam"; $_SESSION['user']=$var; if(isset($_SESSION['user'])) { $_SESSION['user']=$_SESSION['user']+1; } else { $_SESSION['saddam_password']=1; } ?> <body> <?php echo "Hi ".$_SESSION['user']. " You have visited ".$_SESSION['user']." pages"; ?> </body> </html> step by step: 1 star session top  of the page using session_start() php function; 2 define your varibale like this $_SESSION['user']=saddam 3  print your variable like this echo $_SESSION['user']

CONVERT PHP ARRAY INTO EXCEL FILE

CONVERT PHP ARRAY INTO EXCEL FILE  <?php header("Content-Type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=spreadsheet.xls"); $exhibition = array(   array('id' => '1','name' => 'Mr N .Vishwanath','jobTitle' => 'Director','company' => 'SLV  RUBBERPRODUCTS','address' => 'Shed No 7,7th Main ,Doddanna Indl Area') );   echo "<table border='1'>"; foreach($exhibition as $data ){  echo "<tr>";   foreach($data as $key=>$val ){    echo "<td>";    echo   $val ;     echo "</td>";   }  echo "</tr>"; } echo '</table>'; echo $i;   ?>