Re: PHP Cuts bottom content off
do you know how to make a dropdown menu required
i am confused on what you said
i sort of fixed it i
added
include_once("gobackbtn.html");
include_once("bottom_site_map_error.html");
so it would cut the content off
im sure i just did a shortcut but not profesionally take a look
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "name@gmail.com";
$email_subject = "SUBJECT.";
function died($error) { // your error code can go here
echo "<br />";
echo "<div align='center'><h1>We are very sorry, but there were error(s)<br /> found with your form submission.</h1></div><br /><br />";
echo "<p style='color:green'><h2> These errors appear below: </h2></p> <br />";
echo $error."<br /><br />";
include_once("gobackbtn.html");
include_once("bottom_site_map_error.html");
die();
}
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['telephone']) ||
!isset($_POST['country']) ||
!isset($_POST['address']) ||
!isset($_POST['drop_down'])) {
died('We are sorry, but there appears to be errors with the form your submitted.');
}
$name = $_POST['name']; // required
$company = $_POST['company'];
$address = $_POST['address']; // required
$addresss = $_POST['addresss'];
$country = $_POST['country']; // required
$telephone = $_POST['telephone']; // required
$mobile = $_POST['mobile'];
$email_from = $_POST['email']; // required
$dropdown = $_POST['drop_down']; //required
$comments = $_POST['comments']; // required
$option = $_POST['radio'];
$model = $_POST['model'];
$modeltype = $_POST['modeltype'];
$location = $_POST['location'];
$list = $_POST['list'];
$levels = $_POST['levels'];
$notes = $_POST['notes'];
foreach($_POST['check'] as $value) {
$check_msg .= "Optional Equip: $value\n";
}
$error_message = "";
$email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
if(!eregi($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "^[a-z .'-]+$";
if(!eregi($string_exp,$name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br />';
}
if(strlen($address) < 2) {
$error_message .= 'The Address you entered does not appear to be valid.<br />';
}
$string_exp = "^[a-z .'-]+$";
if(!eregi($string_exp,$country)) {
$error_message .= 'The Country you entered does not appear to be valid.<br />';
}
$string_exp = "^[0-9 .-]+$";
if(!eregi($string_exp,$telephone)) {
$error_message .= 'The Phone Number you entered does not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
|