Results 1 to 2 of 2
  1. #1

    Java Calender Mail to

    Hi all, I have a contact form:
    PHP Code:
    <?php $thisPage="reserve"?>
    <script src="jquery.ui-1.5.2/jquery-1.2.6.js" type="text/javascript"></script>
    <script src="jquery.ui-1.5.2/ui/ui.datepicker.js" type="text/javascript"></script>
    <link href="jquery.ui-1.5.2/themes/ui.datepicker.css" rel="stylesheet" type="text/css">
    <form method="post" action="?p=send" name='booking1'  onsubmit="return checkFields();">
    <!-- BEGIN -->
    <link type="text/css" rel="stylesheet" href="skyblue.css" >

    <!-- END -->
    <!-- Warning function -->
    <script type='text/javascript'>
    function checkFields()
    {
        if (document.getElementById('fname').value == '')
        {
            alert('Please enter your first name!');
            return false;
        }

        if (document.getElementById('lname').value == '')
        {
            alert('Please enter your last name!');
            return false;
        }


       if (document.getElementById('email').value == '')
        {
            alert('Please enter your email!');
            return false;
        }
       if (document.getElementById('phone').value == '')
        {
            alert('Please enter your phone number!');
            return false;
        }
       if (document.getElementById('date').value == 'Click me!')
        {
            alert('Please select a date!');
            return false;
        }


       if (document.getElementById('rhr').value == 'sel')
        {
            alert('Please enter a time!');
            return false;
        }

       if (document.getElementById('rmin').value == 'sel')
        {
            alert('Please enter a time!');
            return false;
        }

       if (document.getElementById('ampm').value == 'sel')
        {
            alert('Please enter a time!');
            return false;
        }

       if (document.getElementById('nguests').value == '')
        {
            alert('Please enter the amount of guests!');
            return false;
        }
        return true;
        
    }

    </script>

    <!-- DO NOT change ANY of the php sections -->
    <?php
    $ipi 
    getenv("REMOTE_ADDR");
    $httprefi getenv ("HTTP_REFERER");
    $httpagenti getenv ("HTTP_USER_AGENT");
    ?>
    <style type="text/css">
    <!--
    .ralign {
        text-align: right;
    }
    -->
    </style>
    <style type="text/css">
    <!--
    .right {
        text-align: right;
    }
    -->
    </style>
    <body>

    </head>

    <body>
    <cfif IsDefined("form.jQueryUICalendar1")>
    </cfif>
    <table width="742" height="309" border="0">
      <tr>
        <td colspan="4"><center>
        </center></td>
      </tr>
      <tr>
        <td width="100" class="right">First Name:</td>
        <td width="210"><input type='textbox' name='fname' id='fname' class="input"/></td>
        <td width="129">Date of Reservation:</td>
      
        
        <td><input type="text" size="30" value="Click to select date" id="date" class='input'/>
        <script type="text/javascript">
    // BeginWebWidget jQuery_UI_Calendar: jQueryUICalendar1
    jQuery("#jQueryUICalendar1").datepicker();

    // EndWebWidget jQuery_UI_Calendar: jQueryUICalendar1
          </script></td>
        
      </tr>
      <tr>
        <td class="right">Last Name:</td>
        <td><input type='textbox' name='sname' id='lname' class="input" /></td>
        <td>Time of Reservation:</td>
        <td><select name='rhr' id='rhr' class="input" value='Select'>
          <option value='sel'></option>
          <?php
    for ($i=1;$i<13;$i++)
    {   echo 
    "<option value='".$i."'>".$i."</option>";
    }
    ?>
        </select>
          :
          <select name='rmin' id='rmin' class="input" value=''>
            <option value='sel'></option>
            <option value='00'>00</option>
            <option value='15'>15</option>
            <option value='30'>30</option>
            <option value='45'>45</option>
          </select>
          |
          <select name='ampm' id='ampm' class="input" value=''>
            <option value='sel'></option>
            <option value='am'>AM</option>
            <option value='pm'>PM</option>
          </select></td>
      </tr>
      <tr>
        <td class="right">Email:</td>
        <td><input type='textbox' name='email' id='email' class="input" /></td>
        <td>Number of Guests:</td>
        <td><input type='textbox' id='nguests' name='nguests' class="input" /></td>
      </tr>
      <tr>
        <td class="right">Phone:</td>
        <td><input type='textbox' name='phone' id='phone' class="input" /></td>
        <td>Special Requests: </td>
        <td><textarea id='specreq' name='specreq' class="input"></textarea></td>
      </tr>
      <tr>
        <td colspan="3"><strong>To make a booking for today, please contact us on 9510 2820</strong></td>
        <td><input type="image" src="images/submit.gif" height="25" width="125" border="0" alt="Submit Form"></td>
      </tr>
    </table>
    <p>&nbsp; </p>
    <p></p>
    <script type="text/javascript">
    <!--
    jQuery("#jQueryUICalendar1").datepicker();
    //-->
    </script>
    </body>
    The Send Form
    PHP Code:
    [/<?php
    $from 
    "[email protected]";
    $ip $_SERVER['REMOTE_ADDR'];
    $to [email protected]'// This would be your email
    $subject $_POST['fname'] . " " .$_POST['lname'] ." has submitted a reservation for Vin Cellar.";
    $body "First Name: ".$_POST['fname']." \n
    Last Name: "
    .$_POST['sname']." \n
    Email Address: "
    .$_POST['email']." \n
    Telephone Number: "
    .$_POST['phone']." \n
    Date of Reservation: "
    .$_POST['date']." \n
    Time of Reservation: "
    .$_POST['rhr'].":".$_POST['rmin']." ".$_POST['ampm']."
    Number of People: "
    .$_POST['nguests']." \n
    Special Requests: "
    .$_POST['specreq']." \n
    IP: "
    .$ip." \n";
    mail($to,$subject,$body$from);
    ?>

    <center>
    <div><h3>Thank you for your reservation enquiry, we will be in 
    touch to confirm shortly.</h3><p>If you have not heard from us within two days.</p><div>
    </center>
    For some reason it doesn't email the date through.
    The email looks like this:

    First Name: Name

    Last Name: Name

    Email Address: [email protected]

    Telephone Number: 000000000

    Date of Reservation:

    Time of Reservation: 3:30 pm
    Number of People: 15

    Special Requests: No.

  2. #2
    Your date input field doesn't have a name attached to it, so won't be passing PHP any information:

    <input type="text" size="30" value="Click to select date" id="date" class='input'/>
    Add a name="date" parameter and you should be good to go

Similar Threads

  1. Need a bit of help with my PHP calender.
    By Abaddon in forum Programming Discussion
    Replies: 3
    Last Post: 08-25-2006, 02:23 PM
  2. Does my server support Xerces, Xalan and Java Mail ??
    By thomas.smith in forum Hosting Security and Technology
    Replies: 4
    Last Post: 09-17-2004, 03:12 AM
  3. Outlook Calender Support without Exchange
    By Satori in forum Hosting Security and Technology
    Replies: 1
    Last Post: 06-30-2004, 01:49 PM
  4. Calender Script??
    By 6PS-Chris in forum Programming Discussion
    Replies: 4
    Last Post: 09-19-2002, 11:28 AM
  5. Calender ( PHP + MySQL )??
    By Studio64 in forum Web Hosting Lounge
    Replies: 4
    Last Post: 02-25-2002, 11:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •