Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6199541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:12:28+00:00 2026-05-24T04:12:28+00:00

So I have this form on a page and trying to validate values with

  • 0

So I have this form on a page and trying to validate values with PHP, then send the e-mail off. I’m using the Joomla CMS as well. The form submits but none of the values transmit over. Does anyone have any suggestions or ideas to what is going on? Thanks in advance.

http://www.indigoeastend.com/same-sex-weddings

    <?php echo ''; //error_reporting(E_ALL & ~E_DEPRECATED); ?>
    <?php flush(); ?>
    <table style="margin-top:1.2em;">
    <tr>
    <td class="wedding_left">
    <p style="margin-top:0;">New York has said "I do" to same-sex marriage and for your New York wedding choose Hotel Indigo. Here you'll experience all the beauty that can be found on Long Island's famous East End. Right next door to vineyards, beaches the North Fork and the Hamptons we can provide a multitude of wedding event options. Our newly designed hotel offers a chic, contemporary and cosmopolitan setting that will set the stage for your ideal affair.  Hotel Indigo provides a boutique private experience hosting only one wedding at a time–yours.</p>

    <p>Our wedding planner will work with you to create a completely custom event in our exquisitely appointed ballroom or create a tented outdoor space by fascinating poolscape and cabanas. Hotel Indigo features stunning landscapes for photography and stylish areas for your guests to gather and enjoy themselves.</p>

    <p>Our catering team can provide you with a custom menu serving your favorite dishes and signature drinks. We can arrange your beach excursions, wine tours and spa treatments so you and your guests can truly appreciate the NY wedding of your dreams on the East End.</p>
    </td>
    <td class="wedding_right">

    <h1 style="word-spacing:-.15em; margin:0 0 5px 0 !important; font-size:1.5em;">TOUR FOR THE DAY &<br />
    STAY FOR THE NIGHT!</h1>
    <p style="margin-top:0;">
    <b style="color:#1f407e;">Come tour the hotel as a possible venue for your upcoming wedding and receive 
    a free overnight stay*</b>

    <p>Please provide the following information:</p>

    <?php
    $good_to_go = 0;

    if(isset($_POST['first_name'])) {
        $first_name = $_POST['first_name'];
    } else {
        $first_name = '';
    }

    if(isset($_POST['last_name'])) {
        $last_name = $_POST['last_name'];
    } else {
        $last_name = '';
    }

    if(isset($_POST['email'])) {
        $email = $_POST['email'];
    } else {
        $email = '';
    }

    if(isset($_POST['phone'])) {
        $phone = $_POST['phone'];
    } else {
        $phone = '';
    }

    if(isset($_POST['submitIt'])) {
        $submitIt = $_POST['submitIt'];
    } else {
        $submitIt = 0;
    }

    echo 'NAME: '.$first_name.' ';
    echo $last_name.'<br />';
    echo 'EMAIL: '.$email.'<br />';
    echo 'PHONE: '.$phone.'<br />';

    if($submitIt == 1) {
            echo 'WORKS!';
        if ($first_name == '' && $last_name == '' && $email == '' && $phone == '') {
            echo "<p class='red'  style='color:red;'>ERROR: Please fill the form out before submitting it.</p>";
            $good_to_go = 0;
        } elseif ($first_name == '' || $last_name == '' || $email == '' || $phone == '') {
            if($first_name == '') {
                echo "<p class='red no_margin' style='color:red;'>ERROR: Please enter your first name.</p>";
                //$good_to_go = 0;
            }

            if($last_name == '') {
                echo "<p class='red no_margin' style='color:red;'>ERROR: Please enter your last name.</p>";
                //$good_to_go = 0;
            }

            if($phone == '') {
                echo "<p class='red no_margin' style='color:red;'>ERROR: Please enter a phone number.</p>";
                //$good_to_go = 0;
            }

            if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                echo "<p class='red no_margin' style='color:red;'>ERROR: Please enter a valid e-mail.</p>";
                //$good_to_go = 0;
                $email = '';
            }
        } else {
            if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                echo "<p class='red' style='color:red;'>ERROR: Please enter a valid e-mail.</p>";
                //$good_to_go = 0;
            } else {
                //send that puppy!
                $mydate = date ( 'l, F d Y g:i A',time()+240 );

                $to = 'drottino@viridian-graphics.com';

                //e-mail subject
                $subject = 'Someone has submitted a form via the website';

                //e-mail message
                $message = "I am interested in the hotel tour.\r\n\r\n\r\n"

                //."Subject: $contact_subject\r\n"
                ."<b>SUBMITTED ON:</b> ".$mydate."\r\n"
                //."<b>FROM IP:</b> {$_SERVER['REMOTE_ADDR']}\r\n\r\n"
                ."<b>CONTACT NAME:</b> ".$first_name." ".$last_name."\r\n"
                ."<b>MESSAGE:</b> ".$message."\r\n\n";
                //."<b>FORM ADDRESS:</b> {$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";

                $headers = "From: $first_name $last_name <$email>\n"
                ."Reply-To: ".strip_tags($email)."\n"
                ."MIME-Version: 1.0\r\n"
                ."Content-Type: text/html; charset=ISO-8859-1\r\n";

                $good_to_go = 1;
            }
        }
    } else {

    }
    ?>

    <?php if ($good_to_go == 0) { ?>
        <form method="post" action="http://www.indigoeastend.com/same-sex-weddings">
            <p><label for="first_name">FIRST NAME</label><br />
            <input type="text" size="30" name="first_name" value="<?php echo $first_name; ?>" /></p>

            <p><label for="last_name">LAST NAME</label></br >
            <input type="text" size="30" name="last_name" value="<?php echo $last_name; ?>" /></p>

            <p><label for="email">E-MAIL ADDRESS</label><br />
            <input type="text" size="30" name="email" value=""/></p>

            <p><label for="phone">PHONE NUMBER</label><br />
            <input type="text" size="30" name="phone" value="<?php echo $phone; ?>" /></p>

            <input type="hidden" value="1" name="submitIt">
            <input class="button" type="submit" value="Send" /></p>
        </form>
    <?php } else
            //mail($to, $subject, $message, $headers); ?>
        <p>Thank you for submitting your request. We will get back to you shortly.</p>
    <?php } ?>

    <p>Subject to a one hour tour of the<br />
    hotel, advance notice required for<br />
    tour and stay offer.</p>

    <p>*Valid for any 1 night stay sunday–thursday and subject to availability.</p>
    <hr />
    </p>Speak with our wedding planners<br />
    to plan your unique affair<br />
    631.369.2200 | dmazza@eastendhotels.com<br />
    <a href="mailto:dmazza@eastendhotels.com">contact us</a></p>

    <p>Ballroom for up to 240 guests<br />
    Outdoor Tented Space<br />
    Gazebo for ceremonies<br />
    Stylishly furnished Poolscape<br />
    Restaurant & Private Dining Room for rehearsal dinners and brunches<br />
    After-parties<br />
    Transportation planning services<br />
    Hospitality areas<br />
    Bridal Suite & Guest accommodations</p>
    </td>
    </tr>
    </table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:12:29+00:00Added an answer on May 24, 2026 at 4:12 am

    The problem is at line 142.. here, you were missing the { after else. It should be :

    <?php } else {
                //mail($to, $subject, $message, $headers); ?>
            <p>Thank you for submitting your request. We will get back to you shortly.</p>
        <?php } ?>
    

    I did run the code, and it works fine, i can get the submitted values, eg.

    NAME: asdf sasa
    EMAIL: asdf@deded.com
    PHONE: 123
    WORKS!
    
    Thank you for submitting your request. We will get back to you shortly
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get this form to validate email using the function the professor said
I have this situation: There are a login page with a login form (form
I currently have a web form aspx page that calls RegisterClientScriptBlock. This sends down
I have this form. Basically what I want is to send a auto-response with
I am trying to validate a form submission in Kohana 3. I have the
I'm using code form this page: http://z4android.blogspot.com/2011/06/displaying-list-of-music-files-stored.html The code is working, but not soo
This is using jQuery 1.6.1 and Validate 1.8.1. I have been banging my head
Okay, so I have the form set to my PHP page. I also have
I'm using FluentValidation to validate input on an MVC form. I have a checkbox.
I am trying to integrate cpanel to my cms... I have this code to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.