My PHP/ MySQL Restaurant Reservation Form

Two months ago, I’ve developed a contact reservation form in PHP. The form is really easily customizable and is straight forward to integrate.
I’ve developed the form for a small restaurant which was missing the feature on it’s joomla based website in order to be able for restaurant clients to reserve tables.

Here is how my restaurant reservation form looks like:

hip0's plain php restaurant reservation form

Later on I found there are plenty of possibilities to easily make a reservation form in Joomla but at that time I had no idea that custom contact forms can be prepared with Joomla, so I developed my own one from scratch in plain PHP and MySQL.

The form’s fields are in Dutch, because the form I’ve developed for a Dutch restaurant.
However changing the form text is really easy,to do so open the php file and modify it, according to your needs.
I decided to share here the reservation form in hope that it might be helpful to somebody out there.
The Reservation form is licensed under GPLv2 so you’re very welcome to distribute and modify it freely.

The form installation is described in the README file you will find bundled with the reservation form archive.

You can d Download my PHP restaurant reservation form here

Feedback on the form is very welcome!
 

Share this on:

More helpful Articles

Download PDFDownload PDF

Tags: , , , , , , , , , , , , , , , , , , , , , , , , ,

14 Responses to “My PHP/ MySQL Restaurant Reservation Form”

  1. ugank says:
    Firefox 3.6.13 Firefox 3.6.13 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13

    thank’s bro.. God Bless

    View CommentView Comment
  2. ugank says:
    Firefox 3.6.13 Firefox 3.6.13 Windows 7 Windows 7
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13

    but file is corrupt..

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      Hi,
      Which files are corrupt, files are perfectly okay you just need to put your own custom configurations in.
      Tell me further what’s the problem and maybe I can help you to fix that.

      View CommentView Comment
  3. Suresh says:
    Firefox 6.0 Firefox 6.0 Windows XP Windows XP
    Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20100101 Firefox/6.0

    Thanks for sharing.
    Working perfect!

    View CommentView Comment
  4. confused says:
    Firefox 6.0.2 Firefox 6.0.2 Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2

    could you supply it in a Zip, or give instructions how to use it as gzip?

    winzip & winrar just say the file is corrupt when trying to extract, might be a good idea to give the install instructions seperate for those of use who have a basic knowledge of this stuff

    View CommentView Comment
  5. Carlos Estrello says:
    Firefox 13.0a2 Firefox 13.0a2 Windows 8 Windows 8
    Mozilla/5.0 (Windows NT 6.2; rv:13.0) Gecko/20120416 Firefox/13.0a2

    Thanks so much, is hard at first because Dutch language, but is great script!

    View CommentView Comment
  6. Hotel Istanbul says:
    Google Chrome 22.0.1229.94 Google Chrome 22.0.1229.94 Windows 7 Windows 7
    Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4

    great script it collects the datas , thx for sharing

    View CommentView Comment
  7. Lester says:
    Firefox 19.0 Firefox 19.0 Windows XP Windows XP
    Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0

    Hello there i was wondering if this php script is usable with this form that i am using.

    Here is the js script for the form:

    $(document).ready(function(){
    $(“#ajax-reservation-form”).submit(function(){
    var str = $(this).serialize();
    $.ajax( { type: “POST”, url: “reservation.php”, data: str, success: function(msg){
    if(msg == ‘OK’) // Message Sent? Show the ‘Thank You’ message and hide the form
    { result = ‘Your message has been sent. Thank you!Our manager will contact you to discuss your staying in our hotel.Reserve another room‘; $(“#reservation_fields”).hide(); }
    else
    { result = msg; }
    $(“#reservation_note”).html(result);
    }
    });
    return false;
    });
    });

    function reservation_freset(){
    $(“#reservation_note”).html(”);
    document.getElementById(‘ajax-reservation-form’).reset();
    $(“#reservation_fields”).show();
    };

    Thanks any help would be great

    View CommentView Comment
  8. arbitrary username says:
    Firefox 42.0 Firefox 42.0 Windows 8.1 x64 Edition Windows 8.1 x64 Edition
    Mozilla/5.0 (Windows NT 6.3; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0

    I know this is an old script, but its method of generating email and SQL queries are naive, unsafe and should be avoided at all costs.

    strip_tags will not protect you. In some cases it won’t even properly strip html tags. Prepared statements should be used for SQL queries – this code doesn’t adequately protect against SQL injection, header injection, or really anything. Please, never use this code in production, and never post it to forums where people know better.

    View CommentView Comment
  9. Matt says:
    Google Chrome 46.0.2490.80 Google Chrome 46.0.2490.80 Mac OS X  10.10.5 Mac OS X 10.10.5
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36

    Congratulations on building this and making it available!

    I’ve noticed the script is vulnerable to SQL injection attacks though. It’s been a while since I did PHP development (I prefer Ruby these days) but look into the mysql_real_escape_string function, or prepared statements. I’d also recommend reading up on SQL Injection and database security in general.

    Don’t be discouraged though, this is very cool, keep it up 🙂

    View CommentView Comment
    • admin says:
      Firefox 38.0 Firefox 38.0 Windows 7 x64 Edition Windows 7 x64 Edition
      Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0

      Thanks for feedback Matt,

      It was a quick form written in few hours for a Kurdish restaurant in Arnhem called Lumier.
      At that time, I didn’t really cared of how secure it is. Finally the Kurdish Muslims, didn’t pay me the money, I’ve requeste
      even though, I give my best to build it so I decided to droppped developing it.

       

      View CommentView Comment

Leave a Reply

CommentLuv badge