How does echo not execute in this code, the master gives a recruit
This post was last edited by xuzuning on 2014-07-01 17:05:54
Public function Add () {
$this->lottory_record_db=m (' Lottery_record ');
$this->lottory_db=m (' lottery ');
if ($_post[' action '] = = ' Add ') {
$lid = $this->_post (' lid ');
$wechaid = $this->_post (' Wechaid ');
$data [' sn ']= $this->_post (' Sncode ');
$data [' phone '] = $this->_post (' tel ');
$data [' Prize ']= $this->_post (' winprize ');
$data [' wecha_name '] = $this->_post (' wxname ');
$data [' Time ']= time ();
$data [' Islottery ']= 1;
$data [' Usenums ']= 1;
$rid =intval ($this->_post (' rid '));
if (! $rid) {
$thisRecord = $this->lottory_record_db->where (Array (' lid ' + $lid, ' wecha_id ' = = $wechaid, ' islottery ' = >1))->find ();
$rid = $thisRecord [' id '];
}
$rollback = $this->lottory_record_db->where (' lid ' + $lid, ' wecha_id ' = = $wechaid, ' id ' and ' = $rid ')- >save ($data);
$record = $this->lottory_record_db->where (array (' id ' = = $rid))->find ();
Echo ' {"Success": 1, "MSG": "Congratulations!" Respectable '. $data [' Wecha_name ']. ' Please keep your cell phone unblocked! Your prize Number: '. $record [' SN ']. ' "} ';
Exit
}
}
------Solution--------------------
if ($_post[' action '] = = ' Add ') {
Condition $_post[' action '] = = ' Add ' is not true, so echo does not execute
------Solution--------------------
Var_dump ($_post[' action ');//output See what the value is? Established conditions?
------Solution--------------------
Var_dump ($_post[' action ');
------Solution--------------------
Then you output is just a JSON string, you need to parse the JS code