If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By Apokalupsis

Thread: Is there a problem with my Contact page form?

  1. #1
    Junior Member
    Join Date
    Aug 2013
    Member #
    1 times

    Is there a problem with my Contact page form?

    Just an odd thing here.

    I don't know if my contact page form is having an issue or not. When I test it (in all major browsers), it woks fine. When I comb over the code, it looks fine.

    Yet, I continue to get emailed from this form, where the text fields are blank. This is a problem of course, because I don't know if it is a legitimate client (or prospective client) trying to reach me...or if it is a weird server issue or maybe even bad code somewhere. I thought it may be spambots, but if that were the case, then I should at least get some text in the email responses.

    I've been trying to figure this out for hours (spanning several days). Sometimes it's best to have fresh eyes. I'm tempted to just use a brand new script (sometimes that is best), but I'd prefer to find out what I did wrong here (if anything) and how to fix it so it doesn't happen again..

    Here's my contact page: Harmony Webworks - Contact Us

    I'm not sure what the "best practice" is here for submitting code to be reviewed so please let me know if I need to do something more, or if I did something wrong. Below is the html, php, and 2 links to the relevant style sheets.

    Here's the html:
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
    <html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Harmony Webworks - Contact Us</title>
    <link rel="shortcut icon" type="image/x-icon" href="images/color/blue/favicon.ico" />
    <!-- Stylesheets -->
    <link href="css/colors/blue.css" rel="stylesheet" type="text/css" />
    <link href="style.css" rel="stylesheet" type="text/css" />
    <link href="css/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />
    <link href="css/slider1.css" rel="stylesheet" type="text/css" />
    <link href="css/nivo-slider.css" rel="stylesheet" type="text/css" />
    <link href="css/tipsy.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="" rel="stylesheet" type="text/css" />
    <link href="" rel="stylesheet" type="text/css" />
    <!--[if IE]>
    <link href="css/ie.css" rel="stylesheet" type="text/css" />
    <!-- JQuery -->
    <script type="text/javascript" src="js/jquery-1.4.4.js"></script>
    <script type="text/javascript" src="js/jquery.fancybox-1.3.4.js"></script>
    <script type="text/javascript" src="" ></script>
    <script type="text/javascript" src="js/jmenu.js"></script>
    <script type="text/javascript" src="js/jquery.validate.js"></script>
    	<div id="parent">
    		<div id="top">
    			<div class="inner">
    				<div id="logo">
    					<a href="index.html"><img src="images/logo.png" alt="Harmony Webworks" /></a>
    				<div id="menu">
    							<a href="index.html">Home</a>
    						<li><a href="gallery.html">Gallery</a></li>
    						<li class="current_page_item"><a href="contact.html">Contact</a></li>
    			</div><!-- End "top-inner" -->
    		</div><!-- End "top" -->
    		<div id="header">
    			<div class="inner">
    				<h1 class="page-title">Contact Page</h1>
    				<h3 class="page-sub">Grab Our Attention</h3>
    			</div><!-- End "header-inner" -->
    		</div><!-- End "header" -->
    		<div id="content">
    			<div class="inner">
    				<div id="main-col">
    					<h3>Contact Form</h3>
    					<p>Use the form below for questions or project ordering (interactive order form coming soon).</p>
    					<!--||||||| BEGIN CONTACT FORM |||||||-->
    					<form id="contact-form" method="post" action="contact.php">
    						<div class="textbox-block">
    								<label class="name">Full Name <span>*</span></label>
    								<input type="text" name="Name" class="Name required" />
    								<label class="email">Email Address <span>*</span></label>
    								<input type="text" name="Email" class="Email required" />
    							<div class="last">
    								<label class="subject">Subject Matter</label>
    								<input type="text" name="Subject" class="Subject" />
    						<div class="textarea-block">
    							<label class="message">Message <span>*</span></label>
    							<textarea name="Message" class="Message required" cols="45" rows="15"></textarea>
    						<p><span class="red">*</span> Indicates required field</p>
    						<p><button type="submit" class="button small color submit"><span>Send Message</span></button></p>
    					<!--||||||| END CONTACT FORM |||||||-->
    				<div id="sidebar">
    					<div class="widget widget-map">
    						<h3 class="widget-title">Current Promotions</h3>
    						<p><strong>66% discount on all websites!</strong></p>
    						<p>Contact me for  details!</p>
    					<!-- <a href="#"><img src="images/promo.gif" alt="Promotion" /></a> -->
    					<div class="widget widget-text">
    						<h3 class="widget-title">To order a project . . .</h3>
    						<p>For all inquiries and orders for websites, logos, or printwork, please use this contact form and I will respond within 12-24 hours.</p>
    						<p>Please leave a phone number if you would like me to call instead of contacting you by email.</p> 
    			</div><!-- End "inner" -->
    		</div><!-- End "content" -->
    	</div><!-- End "parent" -->
    	<div id="footer">
    		<div id="footer-wrap">
    			<div class="inner">
    				<div id="footer-widgets">
    					<div class="widget">
    						<h3>About Harmony Webworks</h3>
    						<p>Harmony Webworks is owned and operated by designer Jeremy Lewis who has over 11 years experience in graphic design and web development. Harmony Webworks, while a newer company, has traditional values of dedicated service, quality work, and true customer satisfaction.</p>
    						<!-- <a href="#">Read More →</a> -->
    					<div class="widget">
    						<h3>Latest Tweets</h3>
    						<div id="twitter">
    							<div id="myTweets" class="twitters"></div>
    						</div><!-- End "twitter" -->
    					<div class="widget">
    						<h3>From The Blog</h3>
    						<div class="recent-post">
    							<h4><a href="#">Coming Soon!</a></h4>
    							<div class="meta-data">
    							<p> </p>
    					<div class="widget">
    						<div class="flickr-widget">
    							<h3>Flickr Photostream</h3>
    							<script type="text/javascript" src=";display=latest&amp;size=s&amp;layout=x&amp;source=user&amp;user=59018165@N07"></script>
                         <div class="recent-post">
    							<h4><a href="#">Coming Soon!</a></h4>
                                 <p>A cool new feature that will showcase client projects in real time!</p>
    				</div><!-- End "footer-widgets" -->
    			<div id="copyright">
    				<div class="inner">
    					<div class="left"><p>&copy; All Rights Reserved.  Site developed by <a href="">Harmony Webworks</a></p></div>
    					<div class="right"><p>Find us on <a href="!/HarmonyWebworks">Twitter</a>, <a href="">Dribbble</a> &amp; <a href="">Facebook</a></p></div>
    			</div><!-- End "copyright" -->
    		</div><!-- End "footer-wrap" -->
    	</div><!-- End "footer" -->
    <script type="text/javascript">
    $(window).load(function() {
    <script type="text/javascript" src="js/video-fancybox.js"></script>
    <script type="text/javascript" src="js/custom.js"></script>

    Here's the php:
    PHP Code:

    $Subject "HW Contact Page";
    $EmailFrom Trim(stripslashes($_POST['Name']));

    $Name Trim(stripslashes($_POST['Name']));
    $Email Trim(stripslashes($_POST['Email']));
    $Subject Trim(stripslashes($_POST['Subject']));
    $Message Trim(stripslashes($_POST['Message']));

    // validation
    if (!
    $validationOK) {
    "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";

    // prepare email body text
    $Body "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "\n";

    $Body .= "Email: ";
    $Body .= $Email;
    $Body .= "\n";

    $Body .= "Subject: ";
    $Body .= $Subject;
    $Body .= "\n";

    $Body .= "Message: ";
    $Body .= $Message;
    $Body .= "\n";

    // send email 
    $success mail($EmailTo$Subject$Body"From: $EmailFrom");

    // redirect to success page 
    if ($success){
    "<meta http-equiv=\"refresh\" content=\"0;URL=thanks.html\">";
    "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";


    I appreciate any help you can offer.
    Steve7 likes this.


  3. #2
    Junior Member
    Join Date
    Aug 2013
    Member #
    1 times

    I just validated empty fields in PHP.

    It turns out that when a browser had JS disabled, empty fields would be allowed to be submitted. The fix was server side validation.

  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Montreal, Canada
    Member #
    878 times
    Thanks for sharing the solution. It may be of help to others.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib ~ my current site . . ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 09:37 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: