我对以下代码有疑问。单击保存按钮时不会调用我的函数。
这是保存功能的以下代码,
if(isset($_POST['Save'])) // If the submit button was clicked
{
echo "hgfd";
$post['ProductSegmentCode'] = $_POST['ProductSegmentCode'];
$post['ProductSegment'] = $_POST['ProductSegment'];
$post['ProductGroup'] = $_POST['productgroup'];
// This will make sure its displayed
if(!empty($_POST['ProductSegment'])&&!empty($_POST['ProductSegmentCode'])&&!empty($_POST['productgroup']))
{
echo "SAVE";
$news->addNews($post);
?>
<script type="text/javascript">
alert("Created Sucessfully..!!");
</script>
<?
}
else
{
?>
<script type="text/javascript">
alert("Enter Mandatory Fields");
</script>
<?
}
}
以下是html中的按钮格式,
<div style="width:70px; height:32px; float:left; margin-top:16px; margin-left:4px;">
<input name="Save" type="button" class="button" value="Save">
</div>