Editing Tour Data
Finally, let's implement the functionality of editing tour data.
Differences between editing and creating tours
Here are some differences between edit-tour.php
and create-tour.php
:
- In
edit-tour.php
, we have a tour ID provided as a query parameter. We put it inside a variable so we can use it later. When there is noid
query parameter, it is technically a bad request, so we might show an error page, but for now, we just redirect the user to the list of tours. - In the title of the page (the
<h1>
element), we indicate that the user is now editing the tour with the given ID.
Get hands-on with 1400+ tech skills courses.