Hello!!
Thank you in advance for viewing my post. I have a PHP form that I am reusing. In the original format I had the validate function working, but when I paste in my new doc it does not work. The form works but if you leave fields blank the form still submits. I have gone over this code and just cannot find my typo or where the form is going wrong. I am a newbie to PHP. I have tried reading other posts on this same subject but cannot find any scripts that look like mine so I can compare and see where it is going wrong.
Any help would be greatly appreciated.
Thanks!
Sandra 
FORM HTML BELOW:
[code]
PAPERCUTZ :: Graphic Novel Publisher for Tweens & Teens
![]() |
<li><a class="MenuBarItemSubmenu" href="#">COMICS HOME</a>
<ul>
<li><a href="http://www.papercutz.com/bionicle/index.html">BIONICLE</a></li>
<li><a href="http://www.papercutz.com/classics/windwillow/willowhome.html">Classics Illus.</a></li>
<li><a href="http://www.papercutz.com/disneyfairies/">Disney Fairies</a></li>
<li><a href="http://www.papercutz.com/garfield/index.html">Garfield & Co</a></li>
<li><a href="http://www.papercutz.com/stilton/index.html">Geronimo Stilton</a></li>
<li><a href="http://www.papercutz.com/hb/hb.html">Hardy Boys</a></li>
<li><a href="http://www.papercutz.com/ninjago_ss/">LEGO NINJAGO</a></li>
<li><a href="http://www.papercutz.com/nd/nd.html">Nancy Drew</a></li>
<li><a href="http://www.papercutz.com/paperslices/slices_moreinfo.html">Papercutz Slices</a></li>
<li><a href="http://www.papercutz.com/smurfs/">The Smurfs</a></li>
<li><a href="http://www.papercutz.com/tc/tc.html">Tales from the Crypt</a></li>
<li><a class="MenuBarItemSubmenu" href="#">Other Series</a>
<ul>
<li><a href="http://www.papercutz.com/new8x10/dance/">Dance Class</a></li>
<li><a href="http://www.papercutz.com/new8x10/ernest/">Ernest</a></li>
<li><a href="http://www.papercutz.com/new8x10/monster/">Monster</a></li>
<li><a href="http://www.papercutz.com/new8x10/sybil/">Sybil</a></li>
NEWS
WHERE TO FIND
ABOUT
<!-- #EndLibraryItem -->
<p class="style2"> </p>
<p class="style2"> </p>
<p><a href="../images/LEGONINJAGOFLYER.pdf"><img src="../images/lego_contest_s1.jpg" width="661" height="106" alt="LEGO Ninjago Contest" /></a></p>
<p><a href="../images/LEGONINJAGOFLYER.pdf">A Papercutz Promotion with Comicshops</a></p>
<p>Showcase local kids' creativity! Award a great graphic novel prize package from Papercutz!</p>
<p>Get free books for your store!</p>
![]()
Download our LEGO Ninjago Comicshops Contest flyer for more information.
A downloadable, customizable press release and community flyer will be available soon.
If you are interested in participating, please fill out the form below.
<p class="formP" >
<label>Contact Name:</label>
<span class="star">*</span>
<input type="text" name="Name" id="Name" size="40" class="element text" />
</p>
<p class="formP"style="clear:both;" >
<label >Store Name:</label>
<span class="star">*</span>
<input type="text" name="Storename" id="Storename" size="40" class="element text" />
</p>
<p class="formP">
<label>Street Address:</label>
<span class="star">*</span>
<input type="text" name="Address"id="Address" size="40"class="element text" /></p>
<p class="formP"><label>City:</label>
<span class="star">*</span>
<input type="text" name="City" id="City" size="40" class="element text" />
</p>
<p class="formP">
<label>State:</label>
<span class="star">*</span>
<input type="text" name="State"id="State" size="40" class="element text" />
</p>
<p class="formP">
<label>Zip:</label>
<span class="star">*</span>
<input type="text" name="Zip"id="Zip" size="40"class="element text" />
</p>
<p class="formP">
<label > Phone:</label>
<span class="star">*</span>
<input type="text" name="Phone"id="Phone" size="40"class="element text" />
Email:
*
<p class="formP">
<label class="longlabel">Please describe how you plan to promote this contest with co-op funds and other efforts.</label>
</p>
<p class="formP"> </p>
<p class="formP">
VISIT OUR AUTHOR/EDITOR BLOG | SEND US YOUR COMMENTS!
Papercutz • 40 Exchange Place, Suite 1308 • New York, NY 10005 • 800 886 1223
LOOKING FOR ARTISTS!!
Nancy Drew & The Hardy Boys are registered trademarks of Simon & Schuster, Inc.
Disney Fairies © Disney Enterprises. All rights reserved.
©2006 Papercutz. All rights reserved.
LEGO, the LEGO logo, BIONICLE, and the BIONICLE logo are trademarks of the LEGO Group. ” 2008 The LEGO Group. All Rights Reserved.
Tales from the Crypt © 2008 William M. Gaines, Agent, Inc.
Geronimo Stilton © Atlantyca S.p.A.
|
[/code]
PHP Response code here:
[code]<?php
session_start();
$errors = array ();
$errors_msg = null;
$input_arr = array();
foreach ($_POST as $key => $input_arr) {
$_POST[$key] = addslashes($input_arr);
}
$f_name = ($_POST[‘Name’]);
$storename = ($_POST[‘Storename’]);
$addr = ($_POST[‘Address’]);
$city = ($_POST[‘City’]);
$state = ($_POST[‘State’]);
$zip = ($_POST[‘Zip’]);
$phone = ($_POST[‘Phone’]);
$em = ($_POST[‘Email’]);
$describe = ($_POST[‘describe’]);
$ms .="
From: $f_name of $storename \n
$f_name \n
$storename \n
$addr \n
$city \n
$state \n
$zip \n
$phone \n
$em\n
Please describe how you plan to promote this contest with co-op funds and other efforts. \n
$describe ";
$email="[email protected]";
mail($email,‘Comic Shops Mailing List’.$_SERVER[‘remote_addr’], $ms); ?>
PAPERCUTZ :: Graphic Novel Publisher for Tweens & Teens
body {
background-color: #FC3;
}
THANKS FOR JOINING OUR MAILING LIST!
![]()
Download our LEGO Ninjago Comicshops Contest flyer for more information.
A downloadable, customizable press release and community flyer will be available soon.
VISIT OUR AUTHOR/EDITOR BLOG | SEND US YOUR COMMENTS!
Papercutz • 40 Exchange Place, Suite 1308 • New York, NY 10005 • 800 886 1223
LOOKING FOR ARTISTS!!
Nancy Drew & The Hardy Boys are registered trademarks of Simon & Schuster, Inc.
Disney Fairies © Disney Enterprises. All rights reserved.
©2006 Papercutz. All rights reserved.
LEGO, the LEGO logo, BIONICLE, and the BIONICLE logo are trademarks of the LEGO Group. " 2008 The LEGO Group. All Rights Reserved.
Tales from the Crypt © 2008 William M. Gaines, Agent, Inc.
Geronimo Stilton © Atlantyca S.p.A.
|
[/code]