How to navigate the URL after booking page I have node content type for booking and created booking page in drupal 7 and same page is displaying error, confirmation and booking page. I am trying to split into three different pages(nodes) using same node--booking.tpl.php content type. I have custom booking.class.php that manages the booking process using two steps function prebooking and postbooking 

After booking, I would like to redirect to xyz.com/booking-confirm if it's successfully booking and if it's error xyz.com/booking-error and currently, using xyz.com/booking for all actions.

What should I do? I am not sure, which option works. I have found this using some articles and stuck at this point.


Should I use header to redirect it?

header('Location: /booking-confirm'); 
header('Location: /booking-error'); 

Should I hook them in template.php?

function MYMODULE_user_register_form($form, &amp;$form_state) {
    $form_state['redirect'] = 'path/to/somewhere';
}
Should I use drupal_goto to redirect it? it's in booking.class.php class? 
Should I use hook_init? It's in template.php or booking.class.php ?


I am not sure, which is correct option to figure it out. I would like to split the URL using same content type. Any approach to solve the issue.
You should use form state to do redirects since users are interacting with forms. header is not really want you want and neither is drupal_goto.

The class(es) should return either a success/fail style response to the caller (in form submit) and based on that, you should handle the response and redirect with form_state redirect. The only job of your booking class should be to create a booking, it does not need to handle redirects or worry about any of that logic.

Also, no, absolutely don't do redirects from hook_init.

Vanilla example:

function myform_submit($form, &amp;$form_state) {
  $book = new MyBookingClass();
  $form_data = $form_state['values'];

  // createBooking() returns either TRUE or FALSE

  if ($book-&gt;createBooking($form_state['values'])) {
    $form_state['redirect'] = '/booking-confirm';
  } else {
    // There was some sort of error.
    $form_state['redirect'] = '/booking-error';
  }
}