For simplified code. It takes about half a month to guide csdn. I have gained a lot and want to settle down here.
I like the atmosphere and the great gods here.
If (empty ($ grouptypeid) {ShowMsg ('specify the exam! ','-1'); exit ();} if (empty ($ content) {ShowMsg ('content cannot be blank! ','-1'); exit ();} if (empty ($ teachername) {ShowMsg ('select the instructor! ','-1'); exit ();} if (empty ($ years) {ShowMsg ('select date', '-1 '); exit ();} if (empty ($ isupdate) {ShowMsg ('select the update date', '-1'); exit ();}How can this be simply written?
Reply to discussion (solution)
This code should be simplified when the related variable is assigned a value.
You are verifying the incoming data. Obviously
$ Grouptypeid = $ _ POST ['grouptypeid'];
Such a code segment
Therefore
$ Dict = array ('grouptypeid' => 'Please specify the exam! ', 'Content' =>' content cannot be blank! ', 'Teachername' =>' select a teacher! ', 'Ears' =>' select a date', 'isupdate' => 'select an update date',); foreach ($ _ POST as $ k => $ v) {if (empty ($ v) {ShowMsg ($ dict [$ k], '-1'); exit ;}$ $ k = $ v ;}
The idea on the West floor is the same as that on me. I did the same when I was not sure about it. A little like abstract taste
The idea on the West floor is the same as that on me. I did the same when I was not sure about it. It's a bit like an abstract taste.