All pastes #229305 Raw Edit

CBTC

public text v1 · immutable
#229305 ·published 2006-10-30 16:32 UTC
rendered paste body
</tr>

			</table>

		</form>

<?php

   } else {

   

// error_reporting(0);

// error_reporting(E_ALL & ~E_NOTICE);

		

// Here we will begin an array to contain any errors we might encounter

// This allows the form to display all the page errors at the same time

      $errors = array();



// The next test is a small security feature to ensure the form being submitted to us is actually our form

// When doing testing, you quite possibly will get an "Inavlid referer" error

// If this error appears in testing, simply comment out the first 3 lines below, but remember to uncomment it when going live

      $page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];

      if (!ereg($page, $_SERVER['HTTP_REFERER']))

         $errors[] = "Invalid referer";

// BELOW WE SET ALL THE $_POST VARIABLES FOR VALIDATION & EMAIL & MYSQL INJECTION

$firstname = trim($_POST['fname']);
$lastname = trim($_POST['lname']);

// check to see if a first name was entered

      if (empty($fname))

         $errors[] = "Your First Name is required";

   

// check to see if a last name was entered

      if (empty($lname)
)
         $errors[] = "Your Last Name is required";