awk,xenomorf.... sy dah buat mcm awk buat itu..dah xkeluar error tp data xnk insert dlm dtabase....sy pn tak tau ape mslahnye
- Code:
<?php
include ("config.php"); // include() config.php
//add process
if(isset($_POST["submit"])){
mysql_query("INSERT INTO staff
(id_staff,username,password,name,age,gender,birth,position,dept,add,tel_of,tel_hp,email,fax_num,pic)
VALUES (
'".$_POST["id_staff"]."',
'".$_POST["username"]."',
'".$_POST["password"]."',
'".$_POST["name"]."',
'".$_POST["password"]."',
'".$_POST["age"]."',
'".$_POST["gender"]."',
'".$_POST["birth"]."',
'".$_POST["position"]."',
'".$_POST["dept"]."',
'".$_POST["add"]."',
'".$_POST["tel_of"]."',
'".$_POST["tel_hp"]."',
'".$_POST["email"]."',
'".$_POST["fax_num"]."',
'".$_POST["pic"]."'
)");
//redirect page to cat list
print "<meta http-equiv='refresh' content='1;URL=?page=home'>";
print "<tr>
<td align='center' bgcolor='#99CC33'><strong><h1>Add Data Successfull</h1></strong></td>
</tr><br />";
}
?>
<form name='borang' method='post' action=''>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr><tr bgcolor="#FFCCCC">
<td colspan="2" align="center"><strong>Staff Information</strong></td>
</tr>
<tr>
<td width="123">Staff Id:</td>
<td width="357"><input type="text" name="id_staff" id="id_staff"></td>
</tr>
<tr>
<td>Username:</td>
<td>
<input name="username" type="text" id="username" size="40">
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type="password" name="password" id="password">
</td>
</tr>
<tr>
<td>Name:</td>
<td>
<input name="name" type="text" id="name" size="40">
</td>
</tr>
<tr>
<td>Age:</td>
<td>
<input name="age" type="text" id="age" size="8">
</td>
</tr>
<tr>
<td>Gender:</td>
<td>
<input type="radio" name="gender" id="gender" value="radio">
Male
<input type="radio" name="gender" id="gender" value="radio2">
Female</td>
</tr>
<tr>
<td>Birth of Date:</td>
<td>
<input type="text" name="birth" id="birth">
(dd/mm/yyyy)</td>
</tr>
<tr>
<td>Position:</td>
<td>
<input name="position" type="text" id="position" size="40">
</td>
</tr>
<tr>
<td>Department:</td>
<td>
<input name="dept" type="text" id="dept" size="40">
</td>
</tr>
<tr>
<td>Year of services:</td>
<td>
<input type="text" name="services" id="services" />
</td>
</tr>
<tr>
<td height="69">Address</td>
<td>
<textarea name="add" id="add" cols="45" rows="5"></textarea>
</td>
</tr>
<tr>
<td>Tel Office:</td>
<td>
<input type="text" name="tel_of" id="tel_of">
</td>
</tr>
<tr>
<td>Tel Hp:</td>
<td>
<input type="text" name="tel_hp" id="tel_hp">
</td>
</tr>
<tr>
<td>Email:</td>
<td>
<input name="email" type="text" id="email" size="40">
</td>
</tr>
<tr>
<td>Fax_num:</td>
<td>
<input type="text" name="fax_num" id="fax_num">
</td>
</tr>
<tr>
<td>Pic:</td>
<td>
<input type="file" name="pic" id="pic">
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="reset" name="Reset" id="button" value="Reset">
<input type="submit" name="submit" id="submit" value="Register">
</td>
</tr>
</table>
</form>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr valign="middle">
<td> </td>
</tr>
</table>