Wednesday, April 13, 2011

Insert records(php)

<?php
          include("connect.php");
      if(isset($_POST['save']))
      {
            include("connect.php");
             $to=$_POST['to'];
             $from=$_POST['from'];
             $subject=$_POST['subject'];
               $ref=$_POST['ref'];
              $cont1=$_POST['cont1'];
            if($to=="" || $from=="" || $subject=="" || $ref==""|| $cont1=="" )
                   
            {
                    echo'<font style="font-family:Tahoma;font-size:11px;color:#990000">&nbsp;&nbsp;Please input all fields</font>';
                    //echo '<meta http-equiv=Refresh content=1;url=SCat.php>';
            }
            else
            {       
                               
$result = "INSERT INTO `tbl_memo` (`to`, `from`, `subject`, `date`, `refNum`, `cont1`,`rd`) VALUES ('$to', '$from', '$subject', '$d',$ref, '$cont1','n')" ;
$rs2 = mysql_query($result) or die("Invalid Query <br>$result");
                           
  echo "<meta http-equiv=\"refresh\" content=\"0;URL=memo_msg.php\">";
            }
                           
                       
                               
    }
       
?>

No comments:

Post a Comment