Recently Browsing 0 members
No registered users viewing this page.
I have a site that has events where the users can make a reservation and something really weird is happening. This is the code:
$form = array( 'name' => $sanitizer->text($input->post->name), 'email' => $sanitizer->email($input->post->email), 'phone' => $phone, ); $p = new Page(); $p->template = 'reservation'; $p->parent = wire('pages')->get('/agenda/' . $sanitizer->text($input->post->page_target) . '/'); $p->name = microtime(); $p->title = $form['name']; $p->save(); // CODE TO SEND EMAIL BELOW The user path is:
1. User fills the form with name, email, phone and some more information.
2. Form is validated to see if every information is ok.
3. Information is saved into a new page (reservation template).
4. Send email to user.
Everything works fine except in one case:
When the same user fills the same form more than once (to add reserves for one or more friends), usually using the same number and email, the friend's name is not filled in the "title" field. This seems to be the only field that fails, it shows empty on the backoffice. However, the email sent to the user has the name (using the same $form['name'] variable).
Am I missing something?