在magento中是否有任何服務器端表單驗證?我創建了一個使用magentos表單驗證的工具,但如果有人禁用了javascipt並輸入了一些可能有害的東西,它就不會工作。如果沒有內置課程的話。有人可以請我指出如何實現服務器端表單驗證作爲備份的方向。這裏是形式Magento服務器端表單驗證
<div style="border:0px solid red; margin:0px auto;">
<?php $_product = $this->getProduct(); ?>
<form id="test" action="<?php echo Mage::getUrl('pricenotify/pricenotify/db') ?>" method="post">
<label for="price">Price *</label>
<input type="text" id="price" name="price" value="" class="required-entry validate-number"/><br />
<label for="email">Email Address *</label>
<input type="text" id="email" name="email" value="" class="required-entry validate-email"/>
<input type="hidden" id="id" name="id" value="<?php echo $_product->getId() ?>" />
<input type="hidden" id="propri" name="propri" value="<?php echo $_product->getPrice() ?>" />
<input type="submit" name="submit" value="<?php echo $this->__('Submit') ?>" onclick="if(customForm.validator && customForm.validator.validate()) this.form.request(); return false;" />
</form>
<script type="text/javascript">
//< ![CDATA[
var customForm = new VarienForm('test',false);
//]]>
</script>
OP明確要求進行服務器端驗證。原型只有js和客戶端(也真的**不**安全) –