コード例 #1
0
ファイル: contact.php プロジェクト: TaylorMonacelli/phplib
<?php

include $DOCUMENT_ROOT . '/phplib/prepend.php';
page_open(array("sess" => $_ENV["SessionClass"]));
include "phplib/subnav.inc";
echo "<script language=JavaScript>\nfunction DoCustomChecks(f) {\n        return true;\n}\n</script> \n";
$db = new $_ENV["DatabaseClass"]();
echo "<h2>Contact Us</h2>";
$f = new contactform();
echo "<h4>{$submit}</h4>";
$domain_name = str_replace("www.", "", $SERVER_NAME);
if ($submit) {
    switch ($submit) {
        case "Submit":
        case "Save":
            $submit = "Add";
        case "Add":
            if (!$f->validate($result)) {
                $cmd = $submit;
                echo "<font class=bigTextBold>{$cmd} contact</font>\n";
                $f->display();
                echo "</div>";
                page_close();
                exit;
            } else {
                $f->save_values();
                echo "<b>Thank you!</b> someone will contact you soon.<br>\n";
                echo "<META HTTP-EQUIV=REFRESH CONTENT=\"10; URL=/contact.html\">";
                echo "&nbsp<a href=\"/contact.html\">Back to contact.</a><br>\n";
                echo "</div>";
                page_close();
コード例 #2
0
<?php

$form = new contactform(array('to' => 'John <*****@*****.**>', 'from' => 'Contact Form <*****@*****.**>', 'subject' => 'New contact form request', 'goto' => $page->url() . '/status:thank-you'));
?>
<section id="contactform">

  <?php 
if (param('status') == 'thank-you') {
    ?>

  <h1>Thank you very much for your request</h1>
  <p class="contactform-text">We will get in contact as soon as possible</p>
  
  <?php 
} else {
    ?>

  <h1>Get in contact</h1>
  
  <form action="#contactform" method="post">
    <fieldset>
    
      <?php 
    if ($form->isError('send')) {
        ?>
      <div class="contactform-alert">The email could not be sent. Please try again later.</div>
      <?php 
    } elseif ($form->isError()) {
        ?>
      <div class="contactform-alert">The form could not be submitted. Please fill in all fields correctly.</div>
      <?php