php 2

existing customer and php 2


 <script>
    // This line generates a random number either 0 or 1
    var charand = Math.ceil(Math.random() * 2);
    
    // this line creates a text array where useThis[0] is first and useThis[1] is last
    // that is used in the prompt for data entry based on the value of charand    
    var useThis = ["first", "last"];
    
    </script>
<!-- These are in-line styles. You can change the look of all the relevant items at once simply by changing it here -->
<style>
    p.redPara    {
        color:            #FF0000;
        font-family:     Verdana;
        font-style:     italic;
        font-size:         14px;
        font-weight:     bold;
    }
    
    p.normal    {
        color:            #000000;
        font-family:     Verdana;
        font-size:         14px;
        font-style:     normal;
        }
    
    p.pageNotes    {
        color:            #000000;
        font-family:     Verdana;
        font-size:         14px;
        font-style:     normal;
    
        }

    .pageNotesCentre    {
        color:            #666666;
        font-family:     Verdana;
        font-size:         14px;
        font-style:     normal;
        text-align:        left;
        margin-top:     5px;
        margin-bottom:     20px;
           width:             200px;
        }
    
    div.InputBlock {
        display: inline-block;
        vertical-align: top;
        padding-top:     7px;
          padding-right:     10px;
          padding-bottom: 10px;
          padding-left:     10px;
        /*border: solid black 0.5px;*/
        }
    div.question    {
        display:         inline-block;
        vertical-align: top;
        padding-top:     10px;
          padding-right:     10px;
          padding-bottom: 10px;
          padding-left:     10px;
          
        width:             200px;
        
        color:            #000000;
        font-family:     Verdana;
        font-size:         14px;
        font-style:     normal;
        /*border: solid black 0.5px;*/
        }

</style>

<form name="contactform" method="post" autocomplete="off" onSubmit="return Verify(this);" action="php2.php">


<p class="redPara">
   Reminder: You MUST be completing this form
   before 6 pm on the day of the gig.
   </p>
<p class="pageNotes">
    <strong> You are asked to pay IN CASH on entry. <br><br>
    Please note once you have paid and entered no refunds will be given under ANY circumstances as we do
    not issue tickets. <br><br>
    This extends to include technical failures, power cuts or members of 
    the band (or audience/you) falling ill mid-performance etc. </strong>
      </p>
   
<p></p>
   
   
<p class="redPara">Sections marked <span class="blk">*</span> must be completed</p>

<div>
    <div class="question">
            First Name *
        </div>
    <div class="InputBlock">
            <input  type="text" name="first_name" maxlength="50" size="30"/>
        </div>
    </div>
<div>
    <div class="question">
            Last Name *
        </div>
    <div class="InputBlock">
            <input  type="text" name="last_name" maxlength="50" size="30"/>
        </div>
    </div>
<div>
    <div class="question">
            <strong> GREAT CARE HERE PLEASE <br>
Name of the band </strong>you are coming to see <br>(ONE BAND PER FORM) *
        </div>
    <div class="InputBlock">
            <input  type="text" name="band" maxlength="60" size="30" autocomplete="off"/>
        </div>
    </div>

<div>
    <div class="question">
            How many tickets do you require? *
        </div>
    <div class="InputBlock">
            <select name="formGender">
                <option value="">Select...</option>
                <option value="1">One</option>
                <option value="2">Two</option>
                <option value="3">Three</option>
                <option value="4">Four</option>
                <option value="5">Five</option>
                <option value="6">Six</option>
                <option value="7">Seven</option>
                <option value="8">Eight</option>
                <option value="9">Nine</option>
                <option value="10">Ten</option>
                <option value="10+">10+ (Use Comments Box)
                </option>
                </select>
        </div>
    </div>

<!-- <div>
    <div class="question">
            Do you get our weekly e-mails?
        </div>
    <div class="InputBlock">
            <select name="formMailing">
                <option value="">Select...</option>
                <option value="Yes">Yes</option>
                <option value="No, Please Add Me">No, please add me</option>
                </select>
        </div>
    </div> -->
<div>
    <div class="question">
            Your E-mail Address *
        </div>
    <div class="InputBlock">
            <input  type="text" name="email" maxlength="80" size="30"/>
            <div class="pageNotesCentre">
                <strong>Please type your e-mail address with care:</strong><br>
                
                </div>
        </div>
    </div>

<div>
    <div class="question">
            Telephone Number -Optional
        </div>
    <div class="InputBlock">
            <input  type="text" name="telephone" maxlength="30" size="30"/>
            <div class="pageNotesCentre"><strong>COVID 19 TRACING.</strong> <br>A phone number is required.<br>
                It will NEVER be used for marketing.
                </div>
        </div>
    </div>



<div>
    <div class="question">
            Comments
        </div>
    <div class="InputBlock">
            <textarea  name="comments" maxlength="1000" cols="25" rows="6">
                </textarea>
        </div>
    </div>
<input
type="hidden"
id="address"
name="address"
value="Returning Customer">
<!--

<div>
    <div class="question">
            Your full home address *
        </div>
    <div class="InputBlock">
            <textarea  name="address" maxlength="1000" cols="25" rows="6">
                </textarea>
            <br>
            <div class="pageNotesCentre">This is a members club and your FULL address is required. <br>
            If you do not include your address we may write back and ask for it before
            accepting your booking.<br>
            </div>
        </div>
    </div>
-->
<!--

<p class="normal">                
    Please type the <strong><script>document.write(useThis[charand-1])</script></strong> letter of the 
    word <strong>Tropic</strong><br> in the box BELOW
    and then click the Submit button
    </p>
<div>
    <div class="question">
        <input  type="text" name="human" size="10"/>
        </div>

-->

        
    <div class="InputBlock">
        <input type="submit" value="Submit"/>
        </div>
    </div>



<input type="hidden" id="custId" name="custId" value="THIS E-MAIL HAS BEEN SENT TO YOU BY A PERSON AND IS YOUR TICKET CONFIRMATION
You might like to bring a copy of this e-mail to the gig with you, either in print or on a phone.
Please do not write to this e-mail address.
IMPORTANT: To make any changes use the CHANGE AN EXISTING RESERVATION link on the web site at https://www.tropicatruislip.co.uk/change-a-ticket.html
Please do NOT use e-mail to change a ticket also please do NOT try to contact Tropic on Facebook or via Twitter as it will most likely NOT be seen.
Your surname will be on a list on at the door at the venue, please bring CASH and pay when you arrive.
SOME GIGS SELL OUT AND you MUST be in by 9.30 or we reserve the right to release your booking to people who might be waiting for any returns. In this case you might NOT be allowed in.
For address, price, timings etc. go to the web site https://www.tropicatruislip.co.uk or see https://www.tropicatruislip.co.uk/FAQ.html if you have any questions regarding your booking or the venue in general.
Please note we are ostensibly a standing venue. There are a few places to sit but you need to be in early to get them!
Thank you.">


</form>
<SCRIPT>
 
    function Verify(f)        {
        // check the gender
        if (f.formGender.value.length < 1)    {
            alert ("Please select a ticket quantity from the drop down box");
            return false;
   
        }
     
        // check the first name has been entered
        if (f.first_name.value.trim().length < 1)    {
            alert ("You must enter your first name");
            return false;
        }
   
        // check the last name has been completed
        if (f.last_name.value.trim().length < 1)    {
            alert ("You must enter your last name");
            return false;
        }
   
     // check the band name has been completed
        if (f.band.value.trim().length < 1)    {
            alert ("You must enter a band name");
            return false;
        }
     


        // check the email has been completed
        if (f.email.value.trim().length < 1)    {
            alert ("You must enter your email address");
            return false;
        }


/*
     
        // alert(f.address.value.trim().length);
        // check the address has been completed
        if (f.address.value.trim().length < 15)    {
            alert ("You must enter your home address in full");
            return false;
        }
*/


/*

       
        // check the confirmation character
         if (charand == 1 && f.human.value.toUpperCase() != "T" || charand == 2 && f.human.value.toUpperCase() != "C")    {
            alert ("Have you entered the correct letter in the box?");
            return false;
            
        }
*/
        return true;
    }



</SCRIPT>




<?php
//// PHP file for EXISTING CUSTOMER confirmation

 // error_reporting(E_ALL);
 
 
 // prints e.g. 'Current PHP version: 4.1.1'
 // echo 'Current PHP version: ' . phpversion();
 // prints e.g. '2.0' or nothing if the extension isn't enabled
 // echo phpversion('tidy');

 $br="";
 
 if($_POST['debug'] == "1") {
 
  echo "---------- php9 v3 at 08/15/2019 17:44 --------------<br>";
  
  echo '<pre>'; 
  print_r($_POST); 
  echo '</pre>';
  
  $br="<br>";
   
  }
// exit("DONE");
// one check to make sure an email address was provided

if(isset($_POST['email'])) {

    // EDIT THE 3 LINES BELOW AS REQUIRED
    $email_to = "newbookings2@tropicatruislip.co.uk";
    $email_subject = "(EC) (No Reply) Manual confirmation of your ticket for Tropic At Ruislip";
    $link_text = '<a href="default.php"><font color="#000099" face="Verdana" size="2">Return to Home Page</font></a><br /><br />';
//    echo($link_text);
 $first_name = "";
    $last_name = "";
    $email_from = "";
    $telephone = "";
    $band = "";
    $comments = "";
 $address = "";
    $gender = "";
    $hiddentext = "";
    
    
    if(isset($_POST['email']))    $email_from  = $_POST['email']; 
    if(isset($_POST['first_name']))   $first_name  = $_POST['first_name']; 
    if(isset($_POST['last_name']))   $last_name   = $_POST['last_name']; 
    if(isset($_POST['telephone']))   $telephone   = $_POST['telephone'];  
    if(isset($_POST['band']))    $band    = $_POST['band'];   
    if(isset($_POST['comments']))   $comments   = $_POST['comments'];  
    if(isset($_POST['address']))   $address   = $_POST['address'];  
    if(isset($_POST['formGender']))   $formGender  = $_POST['formGender']; 
    if(isset($_POST['custId']))    $custId   = $_POST['custId'];
    
    // and just check the email address is sort of valid  
  
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      if(!preg_match($email_exp,$email_from)) {
       // $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
          
        exit("<p>" .$error_message . "</p><p>Please press the back button on your browser and enter a valid email adddress</p>");  
          
          }    
    
    $email_message = "Booking details below.\n\n";

    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
     }

    if (trim($_POST['first_name']) != "") $email_message .= "First Name: "   .clean_string($first_name)."\n\n" .$br;
    if (trim($_POST['last_name'])  != "") $email_message .= "Last Name: "   .clean_string($last_name)."\n\n" .$br;
    if (trim($_POST['email'])   != "") $email_message .= "Email: "    .clean_string($email_from)."\n\n" .$br;
    if (trim($_POST['telephone']) != "") $email_message .= "Telephone: "   .clean_string($telephone)."\n\n" .$br;
    if (trim($_POST['band'])   != "") $email_message .= "Band: "    .clean_string($band)."\n\n"   .$br;
    if (trim($_POST['formGender']) != "") $email_message .= "Ticket Quantity: " .clean_string($formGender)."\n\n" .$br;
    if (trim($_POST['comments'])  != "") $email_message .= "Any Comments: "  .clean_string($comments)."\n\n"  .$br;
 if (trim($_POST['address'])  != "") $email_message .= "Address: "   .clean_string($address)."\n\n"  .$br;
    if (trim($_POST['custId'])   != "") $email_message .= "Please Note: "  .clean_string($custId)."\n\n\n"  .$br;
 
 

 if($_POST['debug'] == "1") {
 
  echo '<br>I made this look nicer<br>';
  echo '<br>'.$email_message.'<br>';
  
  }
  
 else {
     // create email headers
     $headers = 'From: '.$email_from."\r\n".
     'Reply-To: '.$email_from."\r\n" .
     'X-Mailer: PHP/' . phpversion();
     
     // removed the @ to enable any errors to be displayed 8/12/19 TD
     // @mail($email_to, $email_subject, $email_message, $headers);
     mail($email_to, $email_subject, $email_message, $headers);
 }
   
    // include your own success html here
    // echo "Thank you for contacting us.<br />We will be in touch with you very soon.<br /><br />";

    // ---------------------------------------------------------------------
    // REDIRECT - if you send a variable debug then it won't redirect
    // ---------------------------------------------------------------------
  
 // enter the full url of the page you want to return to here
 
 $strNewLocation="https://www.tropicatruislip.co.uk/acknowledge-a-booking-existing-customer.html";
 if($_POST['debug'] != "1" && $_POST['debug'] != "2"   ) {
 
  // Note:
  // $_SERVER["SCRIPT_URI"] contains the url of this page
  // if the $strNewLocation is set to this page then don't redirect or it will go into an endless loop - that would be silly
  // The if statement checks that they are not the same (force both to lower case just incase!)
  
  if (strtolower($strNewLocation) <> strtolower($_SERVER["SCRIPT_URI"]))    {
  
   echo "<script>\n\r window.location = '" . $strNewLocation . "';\n\r</script>";
   
   }
  }
  
 else {
   
  echo "Debug level " . $_POST['debug'] . " is on<BR>";
  if ($_POST['debug']=="1") echo "NO EMAIL SENT";
  echo "<BR>Redirect would have been:   window.location = '" . $strNewLocation;
  }
 }
 
else    {
    echo "email error. No parameters were set<br>";
 }
?>


Join Our Mailing List

Admit one

To have this blog e-mailed to you each week just join or mailing list from the link below.

Join Our Mailing List