0
なぜ私は$ bookingDateをエコーしているのか理解しようとしています。自分のコードにエコーや印刷の文が残っているわけではないので、レスポンス・コンソールでエコーする理由を理解するのは難しいです。私はこの問題を引き起こしているものを見る人がいることを願っています。ポスト値をエコーする
function submitBooking()
{
$outputArray = array('error' => 'yes', 'message' => 'unproccessed');
$outputMsg = '';
// Sets validation rules for the login form
$this->form_validation->set_rules('eventName', 'Event Name',
'is_natural_no_zero');
$this->form_validation->set_rules('label', 'Label',
'is_natural_no_zero');
$this->form_validation->set_rules('bookingDate', 'Booking Date',
'required');
$this->form_validation->set_rules('location', 'Location',
'required');
$this->form_validation->set_rules('arena', 'Arena',
'is_natural_no_zero');
$this->form_validation->set_rules('introduction', 'Introduction',
'required');
// Checks to see if login form was submitted properly
if (!$this->form_validation->run())
{
$outputArray['message'] =
'There was a problem submitting the form! Please refresh the window and try again!';
}
else
{
$bookingDate = $this->input->post('bookingDate');
$bookingDate = date("d-m-Y h:i:s", strtotime($bookingDate));
if ($this->eventsmodel->bookEvent($this->input->post('eventName'), $this->input->post('label'), $bookingDate, $this->input->post('location'), $this->input->post('arena'), $this->input->post('introduction')))
{
$outputArray = array('success' => 'Yes', 'message' =>
'The event was booked successfully!');
}
else
{
$outputArray['message'] =
'The event was not booked! Please try again later!';
}
}
echo json_encode($outputArray);
}
これはすべてのコードですか? – AlphaMale
私たちはeventsmodel :: bookEvent()のコードを見てみましょう – miro
eventsmodel-> bookEventのコードを投稿してください – AlphaMale