0
我有一個模型 register.php(在應用程序/模型/ register.php)MVC INSERT INTO套牢凡從這裏走
<?PHP
// Load the [default] db group
$this->load->database();
// Get Input from init form, sanitize, plop into variables.
class Register extends Model{
function formModel(){
//load parent constructor
parent::Model();
}
function sanitizeInput(){
var $name = mysql_real_escape_string($_POST['fullname']);
var $email = mysql_real_escape_string($_POST['email']);
var $pass = mysql_real_escape_string($_POST['password']);
var $dySalt = mt_rand(20,100);
var $pass = hash('sha512',$dySalt.$pass);
}
// Set form variables into object; define db table
$registeredObject = new getSanitizeNewRegistrant();
$tbl = 'Fan';
function SendRequestForData(){
if{
$this->db->insert($tbl,$object);
// .. redirect()
echo "Sent";
}
else{
echo "Oops, could not register you";
}
}
}
?>
我加載這個模型到控制器registerUsers .PHP(在應用程序/控制器/ registerUsers.php)
<?PHP
$this->load->model('register'),'', TRUE);
?>
我很困惑我如何去從這裏view
實現這一點?
查看您的代碼後,我建議您通過codeigniter用戶指南並清除您的基本概念 – 2012-03-11 19:50:44
請參閱更新的模型。你現在可以幫我嗎? – CodeTalk 2012-03-11 20:10:26