how can convert the button to disable after click to ensure the data send once
if($_POST[“ok”]){
if($
$username=$_POST[“username”] ;
mysql_query(“insert into switch VALUES (”,’$username’)”);
$msg=”was inserted “;
}
else {
$msg=” not inserted”;
}
}
<form id=”form1″ name=”form1″ method=”post” action=”” >
<table width=”80%” border=”0″>
<tr>
<td colspan=”3″><div align=”center”><?php echo $msg ?></div></td>
</tr>
<tr>
<td width=”32%”><input type=”text” name=”username” id=”username” /></td>
<td width=”63%”>الاسم </td>
<td width=”5%”> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type=”submit” name=”ok” id=”ok” value=”حفظ” /></td>
<td> </td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</form>