public function actionCreate()
// Uncomment the following line if AJAX validation is needed
if($model->hasAttribute('AccountID')) $model->AccountID = Security::getAccountID();
Yii::app()->user->setFlash('over','<b>Your account is over its limit!<b><br><br>' . CHtml::link('Click here to view your account limits.', $this->createUrl('account/index')));
I have searched for the issue and I know many people have resolved the issue by setting in the form
and un-commenting the line in the controller
I have tried this, and it actually makes the problem worse, I end up with 10+ submissions instead of two.
The server this is happening on is on a hosted provider, the code works perfectly fine on my local computers, and it has in the past worked fine on the hosted provider, the issue just started occurring. The provider tells me nothing on the server has changed, and my code has not changed.
Wait, are you trying to do form submissions via ajax? I see no reason why any of your sample code would cause multiple database entries to be saved, unless you are trying to do stuff via ajax and you are doing multiple requests accidentally. Check your browser’s network tab if possible to see if multiple requests are being called