Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

data not stored in db

$
0
0
Dear all,
is there any wrong with my codes? the data is not stored in the db, but when i click submit, it come out the message form successfully registered.
Please help.

thank you.

<?php
include "layout.php" ;?>
<html>

<head>
<title>Registration</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/Javascript">
&lt!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('*****  Invalid:  *****\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
<style type="text/css">
&lt!--
body {
	font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
	background: #fdfbfb;
	margin: 0;
	padding: 0;
	color: #000;
	font-size:14px; 
}
ul, ol, dl { 
	padding: 0;
	margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
	margin-top: 0;	
	padding-right: 15px;
	padding-left: 15px; 
}
a img { 
	border: none;
}
a:link {
	color: #03F;
	text-decoration: none;
	
}
a:visited {
	color: #6E6C64;
	text-decoration: none;
}
a:hover, a:active, a:focus { 
	text-decoration: none;
	color: #F00;
}

.container {
	width: 99%;
	background: #FFF;
	margin: auto auto; 
	overflow: hidden; 
}

.content {
	width: 100%;
	float: right;
	padding-top: 0px;
	padding-right: 0;
	padding-bottom: 10px;
	padding-left: 0;
	background-color:#fdfbfb;
}
.style9 {color: #FFFFFF;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
}
.style1 {font-size: large;
	font-weight: bold;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style13 {font-size: medium;
	color: #FFFFFF;
}
.style2 {font-size: medium}
.style15 {color: #CC0000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
.style17 {color: #3300FF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
.style27 {color: #FFFF00}
}
NRA{font-family: Arial; font-size: 16pt;}
.style21 {font-size: medium;
	color: #FFFFFF;
}
-->
</style>
</head>

<body>
<div class="container">
  <div class="content">
   <table width="100%" border="1">
      <tr>
      <td align="left" valign="middle"><table width="100%" border="0">
        <tr>
         <td width="25" align="left" valign="middle"> </td>
          <td width="666" align="left" valign="middle"><strong><font color="#990000" size="3">Registration Status</font></strong></td>
          <td width="407" align="right"><span class="style7"><strong>User :</strong></span><font size="2"><font color="#000000" > <? print "$msg"; ?></font></font> </td>
          &lt!---  <font color="#000000" size="2"><? print "$msg2"; ?></font></span>-->
         &lt!-- <font color="#000000"><? print "$msg1"; ?>-->
        </tr>
      </table></td>
      </tr>
</table>
<table width="86%" height="310" border="0" align="center" cellpadding="0" cellspacing="0">
    
  <tr align="center"> 
    <td height="308" colspan="9" valign="top"> <div align="center"> 
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          &lt!--DWLayoutTable-->
          <tr align="center" valign="middle"> 
            <td width="13%" height="1"></td>
            <td width="10%"></td>
            <td width="9%"></td>
            <td width="9%"></td>
            <td width="8%"></td>
            <td width="8%"></td>
            <td width="10%"></td>
            <td width="11%"></td>
            <td width="10%"></td>
            <td width="12%"></td>
          </tr>
        </table>
        <p><strong>
                  
<?php
include "connection.php";

		$bahagian=$_POST["country"];
		$daerah=$_POST["state"];
		$bertugas=$_POST["city"];
		$nama=$_POST["txtnama"];
		$gred=$_POST["lstgred"];
		$procedure=$_POST["lstprosidur"];
		$tarikh=$_POST["date5"];
		$sijil=$_POST["txtsijil"];
		
		$sql = "INSERT into master(id,bahagian,daerah,bertugas,nama,gred,prosedure,tarikh,nosijil)VALUES('','$bahagian','$daerah','$bertugas','$nama','$gred','$procedure','$tarikh','$sijil')";
		$result=mysql_query($query) or die (mysql_error());
 				
	echo "Form Successfully Registered";
	echo "<br /> <META HTTP-EQUIV = 'Refresh' Content = '4; URL =registration.php'>";	

?>
        </p>
          
       
    </div>
      <div align="center"> </div>
      <blockquote> 
        <div align="center"><strong> </strong></div>
      </blockquote></td>
  <tr> 
    <td width="54" height="2"></td>
    <td width="54"></td>
    <td width="97"></td>
    <td width="4"></td>
    <td width="148"></td>
    <td width="148"></td>
    <td width="30"></td>
    <td width="303"></td>
    <td width="124"></td>
</tr>
&lt!-- end .content --></div>
  &lt!-- end .container --></div>
</body>
</html>

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>