The zendframework controller click Submit. the specified webpage cannot access the test. the array of the obtained form can normally output the table model.
The webpage you specified cannot be accessed!
Error Type: 500
Controller code
Public function additemAction (){
$ Name = $ this-> getRequest ()-> getParam ('name ');
$ Description = $ this-> getRequest ()-> getParam ('Description ');
$ Vote_count = $ this-> getRequest ()-> getParam ('vote _ count ');
/*
Echo $ name, $ description, $ vote_count;
Exit ();*/
$ Data = array (
'Name' => $ name,
'Description' => $ description,
'Vote _ count' => $ vote_count
);
$ ItemModel = new Item ();
$ ItemModel-> insert ($ data );
$ This-> redirect ('OK ');
}
Item. php
// Here Zend_Db_Table must be inherited; otherwise, it is not a table model.
Class Item extends Zend_Db_Table {
// The default primary key is id, which can be left empty
Protected $ _ primary = 'id ';
Protected $ _ name = 'ITEM ';
}
Reply to discussion (solution)
Is your database configured?
"The specified webpage cannot be accessed" Is there a problem with the submitted path?
$ This-> _ redirect ('OK ');
Is the problem solved? I have the same problem.
Ask the master to solve the problem.
Bro, I finally found out why.
That is, if the spelling of a field name in the item table in mysql is incorrect, this result will be returned.
Description is written as descrption in the item table, with a letter I missing.
It took a whole week.