Hello everyone!
I know this is very numb question. But can anyone please help me on seeking the error? I already search the error for the past few days but still cannot find where it is wrong. Anyway there is no error come when its debug but the data not enter to the database. Please kindly help me. Thanks!
register.php
<?php
if (isset($_POST['submit'])){
$link = mysql_connect("localhost","root","root") or die ("Could not connect to the Database Server!");
$db = mysql_select_db("ija", $link) or die ("Could not select Database!");
mysql_query("INSERT INTO staffdb (staff_name,staff_email,staff_username,staff_password) VALUES ('$staff_name','$staff_email','$staff_username','$staff_password')");
$db_close=mysql_close();}
?>
<script type="text/javascript">
function show_alert()
{
var msg = "Successful : Your data saved";
alert(msg);
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PROTON - Internal Job Application Online</title>
<link href="./style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
color: #000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000;
}
a:hover {
text-decoration: underline;
color: #333;
}
a:active {
text-decoration: none;
color: #000;
}
.style1 {
font-size: xx-large;
color: #FFFFFF;
}
.style4 {font-size: 12px}
-->
</style></head>
<form name="form1" method="post" action="index_user.php">
<body>
<div id="nav">
<p align="center"><span class="style1">Internal Job Application</span></p>
<p> </p>
<p> </p>
<table width="468" border="0" align="center">
<tr>
<td width="170"><span class="style4">Full Name</span></td>
<td width="5"><div align="center">:</div></td>
<td width="279">
<label>
<input name="staff_name" type="text" id="staff_name" size="40" />
</label> </td>
</tr>
<tr>
<td><span class="style4">Email</span></td>
<td><div align="center">:</div></td>
<td><input name="staff_email" type="text" id="staff_email" size="40"/></td>
</tr>
<tr>
<td><span class="style4">Username</span></td>
<td><div align="center">:</div></td>
<td>
<label>
<input name="staff_username" type="text" id="staff_username" size="40"/>
</label></td>
</tr>
<tr>
<td><span class="style4">Password</span></td>
<td><div align="center">:</div></td>
<td>
<label>
<input name="staff_password" type="text" id="staff_password" size="40" />
</label> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
<label>
<input name="submit" type="submit" id="submit" value="Submit" onClick="show_alert()"/>
</label>
<label>
<input type="reset" name="Reset" value="Reset" />
</label>
</div></td>
</tr>
</table>
</div>
</body>
</form>
</html>