Posts

Showing posts from August, 2012

contact us page

For Me   <?php  /***************** PHP Code **********************/  require_once( 'config/bootstrap.php' );  if(isset( $_POST ) && ( $_REQUEST [ "mode" ]== 'send' )){ $name  =  strip ( $_POST [ 'txtname' ]);  $email  =  strip ( $_POST [ 'txtemail' ]);  $ph  =  strip ( $_POST [ 'txtphone' ]); $msg  =  strip ( $_POST [ 'txtcomment' ]); $headers  =   "From: " . $email . "\r\n" ;  $headers  .=  'MIME-Version: 1.0'  .  "\r\n" ; $headers  .=  'Content-type: text/html; charset=iso-8859-1'  .  "\r\n" ; $headers  .=  "\r\nX-Mailer: PHP/"  .  phpversion (); $subject  =  "contact us: nethomes.com" ; $message  =  "Name: "  .  $name  . "<br> Phone No: "  .  $ph .  "<br/>Email Id:" . $email  .  "<br/>Message Details : "  .  $msg   ; $to  =   "bit7bpl@gmail.com" ;  // &

add data without html editor

str_replace('&nbsp;',' ',strip_tags($_POST["txtcomment"]))

add more input box in html

Name   Designation   /**************** HTML Code **************************/ <tr> <td width="30%" align="right"  valign="top"> <label class="mylbl">  Contact person  &nbsp;</label></td> <td width="50%"  valign="top"> <table id="addmorecontact"> <tr> <td><label class="mylbl">  Name &nbsp;</label> </td> <td><label class="mylbl"> Designation &nbsp;</label> </td> <!-- <td>  </td>--> </tr> <tr id="inputbox0">     <td><input type="text" name="txtname[]" id="txtname0" style="width:200px" class="box " /> </td> <td> <input type="text" name="txtdesig[]" id="txtdesig0" style="width:185px"

how to upload image into database using php

how to upload file in database in php how to upload image into database using php step 1 1. create database demo CREATE TABLE IF NOT EXISTS `table1` (   `id` int(11) NOT NULL auto_increment,   `file` longblob NOT NULL COMMENT 'file in binary',   `type` varchar(250) NOT NULL,   `name` varchar(250) NOT NULL,   PRIMARY KEY  (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 2. create two file  demo.php photo.php demo.php <?php  $con = mysql_connect ( 'localhost' , 'root' , '' ); mysql_select_db ( 'demo' , $con ); //print_r($_FILES); if(isset( $_REQUEST [ 'sub' ])){   $tpy = $_FILES [ 'txtfile' ][ 'type' ];    $name = $_FILES [ 'txtfile' ][ 'name' ];     $c = file_get_contents ( $_FILES [ 'txtfile' ][ "tmp_name" ]); mysql_query ( "insert into table1(file,type,name) values('" . addslashes ( $c ). "', '" . $tpy .

dd-mm-yyyy in javascript

date format in javascript dd mm yyyy Chang date format in JavaScript function datef(x){ var arr = new Array(); arr=["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; arr2=x.split('-'); i=parseInt(arr2[1],10); d=arr2[2]+"-"+arr[i]+"-"+arr2[0]; return d; }