コード例 #1
0
        $phone = "";
    }
}
// If the submit button was pressed and something was entered in both fields, process data
// (we just print a mesg)
if ($_POST && $dataValid) {
    session_start();
    $_SESSION['custname'] = $_POST['custname'];
    $_SESSION['email'] = $_POST['email'];
    $_SESSION['phone'] = $phone;
    $tempphone = $phone;
    $_SESSION['cdate'] = $_POST['cdate'];
    $_SESSION['description'] = $_POST['description'];
    header('Location:emailus-summary.php');
    include 'query.php';
    store_email($tempcust, $tempemail, $tempphone, $tempdate, $tempdesc);
    exit;
    ?>

<?php 
    // If no submit or data is invalid, print form, repopulating fields and printing Msg mesgs
} else {
    ?>
<!DocType html>
<html lang="en">
	<head>
		<title>In & Out Moving</title>
		<meta charset=utf-8>
		<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"/>
		<meta name="description" content="In and Out Moving Company in Toronto" />
        <meta name="keywords" content="moving, apartment, condo, office, house, company, toronto"/>
コード例 #2
0
$area = "";
$local3 = "";
$local4 = "";
$phone = "";
if ($_POST) {
    $area = $_POST['c_area'];
    $local3 = $_POST['c_local3'];
    $local4 = $_POST['c_local4'];
    $phone = $area . "" . $local3 . "" . $local4;
    $_SESSION['custname'] = $_POST['custname'];
    $_SESSION['email'] = $_POST['email'];
    $_SESSION['phone'] = $phone;
    $_SESSION['cdate'] = $_POST['cdate'];
    $_SESSION['description'] = $_POST['description'];
    include 'query.php';
    store_email($_SESSION['custname'], $_SESSION['email'], $_SESSION['phone'], $_SESSION['cdate'], $_SESSION['description']);
}
if (!$_POST && !$_SESSION) {
    header('Location:innout-emailus.php');
}
session_destroy();
?>
<!DocType html>
<html lang="en">
	<head>
		<title>In & Out Moving</title>
		<meta charset=utf-8>
		<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"/>
		<meta name="description" content="In and Out Moving Company in Toronto" />
        <meta name="keywords" content="moving, apartment, condo, office, house, company, toronto"/>
	<!--font-->