Jump to content

form method="post" - different results in XP and Vista:


sixseven42

Recommended Posts

I am running XP so I cannot verify this.

 

I am a volunteer for my small town's board of health.  I created an online sign-up form where other townspeople can volunteer.  The form is method="post" with action="#result" and uses php to determine whether to render the "signup" version of the page (the signup form) or the "confirmation" version of the page (thank you for volunteering, etc.), after sending the volunteer information to the proper folks using php mail().

 

It has worked perfectly for everyone I have asked to test the form, except for the actual health agent and his secretary in the town hall!  They are not exactly what one would call computer literate, but (over the phone) I talked them through filling out and submitting the form TWICE, and I believe they did it correctly.  When I asked them what kind of computer they're using, they said "brand new!  the newest ones in the building!" so that tells me they're probably running Vista, since no one in the town hall would know how to reload with xp.  That's the only difference I can think of between the "it works" test group and the "it doesn't work" test group.

 

What happens when the Vista group submits the correctly filled out form:

 

(1) NO error message ($errmsg) is displayed, and NO form labels or input fields are highlighted.

 

(2) The "signup" version of the page is rendered again instead of the "confirmation" version, which means this statement is FALSE:

 

if (!$errors && isset($_POST['submit']))

 

(3) The "signupform" still has all of the entries filled in, which means the $_POST variables were read.

 

(4) NO emails were received.

 

I can no longer test the form b/c it has gone live.  The information entered would be sent to the town board of health and the head of the steering committee.  But I would still like to figure out why it only works for xp and mac folks, and not for vista.

 

A summary of my PHP Version 4.4.4 code:

 

<?php
:
:
:
if (isset($_POST['submit'])) {

/*-- Load Post Variables --*/

if (isset($_POST['firstname'])) {
	$firstname = $_POST['firstname'];
}
if (isset($_POST['lastname'])) {
	$lastname = $_POST['lastname'];
}
/*-- Validate Required Fields --*/

if (!$firstname) {$errors['firstname'] = 1;}
if (!$lastname) {$errors['lastname'] = 1;}

if ($errors) {$errmsg = "Please correct errors highlighted in pink.";}
}

/*-- Format Messages --*/

if (!$errors && isset($_POST['submit'])) {
/* format $confirmation message */
/* format $newvolunteer message */
}

/*-- Send Emails --*/

if (!$errors && isset($_POST['submit'])) {
/* send emails */
}
:
:
:
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
:
:
<?php if (!$errmsg && isset($_POST["submit"])) : ?>
<div id="result">
	<h2>Thank You</h2>
	<p class="center bold">If you provided an email address, you should receive the following confirmation shortly:</p>
	<p><?php echo nl2br($confirmation); ?></p>
</div><!-- end result -->
<?php else : ?>
<div id="signup">
	<h2>Volunteers Needed</h2>
	:
	:
	<form name="signupform" method="post" action="#result">
<?php	if ($errmsg) : ?>
	<div id="result">
	<div id="errmsg"><?php echo $errmsg; ?></div>
<?php	endif; ?>
	:
	:
		<th class="r<?php if ($errors['firstname']) {echo " e";} ?>">First Name:</th>
		<td><input <?php if ($errors['firstname']) {echo "class=\"e\" ";} ?>type="text" name="firstname" <?php if ($firstname) { echo "value=\"$firstname\" "; } ?>/></td>
		<th class="r<?php if ($errors['lastname']) {echo " e";} ?>">Last Name:</th>
		<td><input <?php if ($errors['lastname']) {echo "class=\"e\" ";} ?>type="text" name="lastname" <?php if ($lastname) { echo "value=\"$lastname\" "; } ?>/></td>
	:
	:
<?php	if ($errmsg) : ?>
	</div><!-- end result -->
<?php	endif; ?>
:
:
</div><--end signup-->
:
:
<?php endif; ?>
:
:

 

Thanks in advance!

 

 

 

Link to comment
Share on other sites

Browser, huh?  I assume their "brand new" computers came with IE7?

 

I tested this with IE6, IE7, Mozilla FF 2.0.0.6 and Safari.  Some rendering was different, of course, but no difference in results.

 

The trouble I'm having is, if my Vista test group did something wrong, why would there not be any error messages?  Even when they didn't fill out the DOB correctly, they received NO ERRORS.

 

How hard can it be to click the "SEND FORM" (submit) button?  They should at least have received an error message, right?

 

 

Link to comment
Share on other sites

was just posting the same thing:

 

i would expect action="#result" to be valid, implying that the form should submit to the existing page, to anchor #result. But I would try including the script name also or instead:

 

action='yourscript.php'

Link to comment
Share on other sites

Don't use #result as the action.  Make it the same page as the form is (whatever.php), and only have PHP echo the results if it succeeds.  The action attribute expects a URL.

 

Actually, I was thinking the same thing earlier.  I figured I should use php_self with #action?  Or just hardcode the url, except that I know php5 does not allow full http (external) urls.  The #result is the Confirmation message on success, or it jumps over the "Volunteers Needed" and 5 paragraphs of explanation and lands on the error message at the top of the form if it fails.

 

Here is the FORM ONLY:

 

<?php if ($errmsg || !isset($_POST["submit"])) : ?>
<div id="result">
<div id="signup">
	<form name="signupform" method="post" action="#result">
	<h3>Volunteer Sign-Up Form</h3>
	<div id="byline">Fields with a <b>Bold Label</b> are required.</div>
<?php 	if ($errmsg) : ?>
	<div id="errmsg">
		<?php echo $errmsg ?>
	</div>
<?php	endif; ?>

	<div class="sect1">
		<h4>Have you volunteered for Hanson EDS before?:</h4>
		<table class="w75">
		<tr>
			<th class="w20"><input id="edsyes" type="radio" name="edsyesno" value="I have already volunteered for Hanson EDS" <?php if ($edsyes) { echo "checked=\"checked\" "; } ?> onClick="ableEDS();" /> Yes</th>
			<th><input id="steering" type="checkbox" name="steering" value="I am a member of the Steering Committee" <?php if ($steering) { echo "checked=\"checked\" "; } ?> <?php if ($edsno) {echo "disabled=\"true\" ";} ?>/> I am a member of the Steering Committee</th>
		</tr>
		<tr>
			<th class="w20"><input id="edsno" type="radio" name="edsyesno" value="I have NOT volunteered for Hanson EDS before" <?php if ($edsno) { echo "checked=\"checked\" "; } ?> onClick="ableEDS();" /> No</th>
			<th>My assigned position:   <input id="position" type="text" name="position" <?php if ($position) { echo "value=\"$position\" "; } ?> <?php if ($edsno) {echo "disabled=\"true\" ";} ?>/></th>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Name:</h4>
		<table>
		<tr>
			<th class="r<?php if ($errors['firstname']) {echo " e";} ?>">First Name:</th>
			<td><input <?php if ($errors['firstname']) {echo "class=\"e\" ";} ?>type="text" name="firstname" <?php if ($firstname) { echo "value=\"$firstname\" "; } ?>/></td>
			<th class="r<?php if ($errors['lastname']) {echo " e";} ?>">Last Name:</th>
			<td><input <?php if ($errors['lastname']) {echo "class=\"e\" ";} ?>type="text" name="lastname" <?php if ($lastname) { echo "value=\"$lastname\" "; } ?>/></td>
			<th>Middle Initial:</th>
			<td><input type="text" name="initial" size="1" maxlength="1" <?php if ($initial) { echo "value=\"$initial\" "; } ?>/></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Address:</h4>
		<table>
		<tr>
			<th class="r<?php if ($errors['street']) {echo " e";} ?>">Street:</th>
			<td><input <?php if ($errors['street']) {echo "class=\"e\" ";} ?>type="text" name="street" <?php if ($street) { echo "value=\"$street\" "; } ?>/></td>
			<th class="r<?php if ($errors['city']) {echo " e";} ?>">City:</th>
			<td><input <?php if ($errors['city']) {echo "class=\"e\" ";} ?>type="text" name="city" <?php if ($city) { echo "value=\"$city\" "; } else { echo "value=\"Hanson\""; } ?>/></td>
			<th>State:</th>
			<td><input type="text" name="state" size="2" maxlength="2" <?php if ($state) { echo "value=\"$state\" "; } else { echo "value=\"MA\""; } ?> /></td>
			<th class="r<?php if ($errors['zip']) {echo " e";} ?>">Zip:</th>
			<td><input <?php if ($errors['zip']) {echo "class=\"e\" ";} ?>type="text" name="zip" size="5" maxlength="5" <?php if ($zip) { echo "value=\"$zip\" "; } else { echo "value=\"02341\""; } ?>/></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Phone and Email</h4>
		<table>
		<tr>
			<th class="r<?php if ($errors['phone']) {echo " e";} ?>">Home:</th>
			<td><input <?php if ($errors['phone']) {echo "class=\"e\" ";} ?>type="text" name="phone" <?php if ($phone) { echo "value=\"$phone\" "; } ?>/></td>
			<th>Work:</th>
			<td><input type="text" name="workphone" <?php if ($workphone) { echo "value=\"$workphone\" "; } ?>/></td>
			<th>Cell:</th>
			<td><input type="text" name="cellphone" <?php if ($cellphone) { echo "value=\"$cellphone\" "; } ?>/></td>
		</tr>
		<tr>
			<th>Email:</th>
			<td colspan="5"><input type="text" name="email" size="54" <?php if ($email) { echo "value=\"$email\" "; } ?>/></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Preferred Contact Method</h4>
		<table>
		<tr>
			<th><input type="checkbox" name="prefhome" value="Please contact me by Home Phone" <?php if ($prefhome) { echo "checked=\"checked\" "; } ?> /> Home Phone</th>
			<th><input type="checkbox" name="prefwork" value="Please contact me by Work Phone" <?php if ($prefwork) { echo "checked=\"checked\" "; } ?> /> Work Phone</th>
			<th><input type="checkbox" name="prefcell" value="Please contact me by Cell Phone" <?php if ($prefcell) { echo "checked=\"checked\" "; } ?> /> Cell Phone</th>
			<th><input type="checkbox" name="prefemail" value="Please contact me by Email" <?php if ($prefemail) { echo "checked=\"checked\" "; } ?> /> Email</th>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Personal Data</h4>
		<table>
		<tr>
			<th class="r<?php if ($errors['dobmm'] || $errors['dobdd'] || $errors['dobyy']) {echo " e";} ?>">DOB (mm/dd/yy):</th>
			<td><input type="text" <?php if ($errors['dobmm']) {echo "class=\"e\" ";} ?>name="dobmm" size="1" <?php if ($dobmm) { echo "value=\"$dobmm\" "; } ?>/>/<input <?php if ($errors['dobdd']) {echo "class=\"e\" ";} ?>type="text" name="dobdd" size="1" maxlength="2" <?php if ($dobdd) { echo "value=\"$dobdd\" "; } ?>/>/<input <?php if ($errors['dobyy']) {echo "class=\"e\" ";} ?>type="text" name="dobyy" size="1" maxlength="2" <?php if ($dobyy) { echo "value=\"$dobyy\" "; } ?>/></td>
			<th>SSN:</th>
			<td><input type="text" name="ssn1" size="2" maxlength="3" <?php if ($ssn1) { echo "value=\"$ssn1\" "; } ?>/>-<input type="text" name="ssn2" size="1" maxlength="2" <?php if ($ssn2) { echo "value=\"$ssn2\" "; } ?>/>-<input type="text" name="ssn3" size="3" maxlength="4" <?php if ($ssn3) { echo "value=\"$ssn3\" "; } ?>/></td>
			<th>Driver's License:</th>
			<td><input type="text" name="dln" <?php if ($dln) { echo "value=\"$dln\" "; } ?>/></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Emergency Contact Information</h4>
		<table>
		<tr>
			<th class="r<?php if ($errors['emername']) {echo " e";} ?>">Name:</th>
			<td><input <?php if ($errors['emername']) {echo "class=\"e\" ";} ?>type="text" name="emername" size="40" <?php if ($emername) { echo "value=\"$emername\" "; } ?>/></td>
			<th class="r<?php if ($errors['emeraddr']) {echo " e";} ?>">Address:</th>
			<td><input <?php if ($errors['emeraddr']) {echo "class=\"e\" ";} ?>type="text" name="emeraddr" size="40" <?php if ($emeraddr) { echo "value=\"$emeraddr\" "; } ?>/></td>
		</tr>
		<tr>
			<th class="r<?php if ($errors['emerrel']) {echo " e";} ?>">Relationship:</th>
			<td><input <?php if ($errors['emerrel']) {echo "class=\"e\" ";} ?>type="text" name="emerrel" size="40" <?php if ($emerrel) { echo "value=\"$emerrel\" "; } ?>/></td>
			<th class="r<?php if ($errors['emerphone']) {echo " e";} ?>">Phone:</th>
			<td><input <?php if ($errors['emerphone']) {echo "class=\"e\" ";} ?>type="text" name="emerphone" size="40" <?php if ($emerphone) { echo "value=\"$emerphone\" "; } ?>/></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>What are you volunteering for?</h4>
		<table>
		<tr>
			<th><input type="radio" name="voltype" value="Emergency ONLY" <?php if ($voltype1) { echo "checked=\"checked\" "; } ?> onclick="ableHours()" /> Emergency ONLY</th>
		</tr>
		<tr>
			<th><input type="radio" name="voltype" value="Emergency AND Non-Emergencies" <?php if ($voltype2) { echo "checked=\"checked\" "; } ?> onclick="ableHours()" /> Emergency AND Non-Emergency</th>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Non-Emergency Hours Preferred (if applicable)</h4>
		<table>
		<tr>
			<th><input type="checkbox" name="volhoursdm" value="Weekday Mornings" <?php if ($volhoursdm) { echo "checked=\"checked\" "; } ?> <?php if ($voltype1) {echo "disabled=\"true\" ";} ?>/> Weekday Mornings</th>
			<th><input type="checkbox" name="volhoursda" value="Weekday Afternoons" <?php if ($volhoursda) { echo "checked=\"checked\" "; } ?> <?php if ($voltype1) {echo "disabled=\"true\" ";} ?>/> Weekday Afternoons</th>
			<th><input type="checkbox" name="volhoursde" value="Weekday Evenings" <?php if ($volhoursde) { echo "checked=\"checked\" "; } ?> <?php if ($voltype1) {echo "disabled=\"true\" ";} ?>/> Weekday Evenings</th>
		</tr>
		<tr>
			<th><input type="checkbox" name="volhoursem" value="Weekend Mornings" <?php if ($volhoursem) { echo "checked=\"checked\" "; } ?> <?php if ($voltype1) {echo "disabled=\"true\" ";} ?>/> Weekend Mornings</th>
			<th><input type="checkbox" name="volhoursea" value="Weekend Afternoons" <?php if ($volhoursea) { echo "checked=\"checked\" "; } ?> <?php if ($voltype1) {echo "disabled=\"true\" ";} ?>/> Weekend Afternoons</th>
			<th><input type="checkbox" name="volhoursee" value="Weekend Evenings" <?php if ($volhoursee) { echo "checked=\"checked\" "; } ?> <?php if ($voltype1) {echo "disabled=\"true\" ";} ?>/> Weekend Evenings</th>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Volunteer Interests</h4>
		<table>
		<tr>
			<th><input type="checkbox" name="volintc" value="Clinical Work" <?php if ($volintc) { echo "checked=\"checked\" "; } ?> /> Clinical Work</th>
			<th><input type="checkbox" name="volintd" value="Deliveries" <?php if ($volintd) { echo "checked=\"checked\" "; } ?> /> Deliveries</th>
			<th><input type="checkbox" name="volintf" value="Fundraising" <?php if ($volintf) { echo "checked=\"checked\" "; } ?> /> Fundraising</th>
		</tr>
		<tr>
			<th><input type="checkbox" name="volinta" value="Administration" <?php if ($volinta) { echo "checked=\"checked\" "; } ?> /> Administration</th>
			<th><input type="checkbox" name="volinth" value="Health Education" <?php if ($volinth) { echo "checked=\"checked\" "; } ?> /> Health Education</th>
			<th><input type="checkbox" name="volintn" value="Newsletter Production" <?php if ($volintn) { echo "checked=\"checked\" "; } ?> /> Newsletter Production</th>
		</tr>
		<tr>
			<th><input type="checkbox" name="volintp" value="Phone Bank" <?php if ($volintp) { echo "checked=\"checked\" "; } ?> /> Phone Bank</th>
			<th><input type="checkbox" name="volintv" value="Volunteer Coordinator" <?php if ($volintv) { echo "checked=\"checked\" "; } ?> /> Volunteer Coordinator</th>
			<th><input type="checkbox" name="volints" value="Security" <?php if ($volints) { echo "checked=\"checked\" "; } ?> /> Security</th>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Professional/Volunteer Experience</h4>
		<table>
		<tr>
			<th class="center<?php if ($errors['exporg1'] || $errors['exporg2'] || $errors ['exporg3']) {echo " e";} ?>">Organization</th>
			<th class="center">Dates</th>
			<th class="center">Position</th>
			<th class="center">Responsibilities</th>
		</tr>
		<tr>
			<td><input <?php if ($errors['exporg1']) {echo "class=e ";} ?>type="text" name="exporg1" <?php if ($exporg1) { echo "value=\"$exporg1\" "; } ?>/></td>
			<td><input type="text" name="expdates1" <?php if ($expdates1) { echo "value=\"$expdates1\" "; } ?>/></td>
			<td><input type="text" name="exppos1" <?php if ($exppos1) { echo "value=\"$exppos1\" "; } ?>/></td>
			<td><input type="text" name="expresp1" size="36" <?php if ($expresp1) { echo "value=\"$expresp1\" "; } ?>/></td>
		</tr>
		<tr>
			<td><input <?php if ($errors['exporg2']) {echo "class=e ";} ?>type="text" name="exporg2" <?php if ($exporg2) { echo "value=\"$exporg2\" "; } ?>/></td>
			<td><input type="text" name="expdates2" <?php if ($expdates2) { echo "value=\"$expdates2\" "; } ?>/></td>
			<td><input type="text" name="exppos2" <?php if ($exppos2) { echo "value=\"$exppos2\" "; } ?>/></td>
			<td><input type="text" name="expresp2" size="36" <?php if ($expresp2) { echo "value=\"$expresp2\" "; } ?>/></td>
		</tr>
		<tr>
			<td><input <?php if ($errors['exporg3']) {echo "class=e ";} ?>type="text" name="exporg3" <?php if ($exporg3) { echo "value=\"$exporg3\" "; } ?>/></td>
			<td><input type="text" name="expdates3" <?php if ($expdates3) { echo "value=\"$expdates3\" "; } ?>/></td>
			<td><input type="text" name="exppos3" <?php if ($exppos3) { echo "value=\"$exppos3\" "; } ?>/></td>
			<td><input type="text" name="expresp3" size="36" <?php if ($expresp3) { echo "value=\"$expresp3\" "; } ?>/></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Language Fluency (in addition to English)</h4>
		<table>
		<tr>
			<th><input <?php if ($errors['lang1']) {echo "class=e ";} ?>type="text" name="lang1" <?php if ($lang1) { echo "value=\"$lang1\" "; } ?>/></td>
			<th<?php if ($errors['lang1s']) {echo " class=e";} ?>><input type="checkbox" name="lang1speak" value="Speak and Understand" <?php if ($lang1speak) { echo "checked=\"checked\" "; } ?> /> Speak and Understand</th>
			<th<?php if ($errors['lang1s']) {echo " class=e";} ?>><input type="checkbox" name="lang1read" value="Read and Translate" <?php if ($lang1read) { echo "checked=\"checked\" "; } ?> /> Read and Translate</th>
			<th<?php if ($errors['lang1s']) {echo " class=e";} ?>><input type="checkbox" name="lang1write" value="Write" <?php if ($lang1write) { echo "checked=\"checked\" "; } ?> /> Write</th>
<?php if ($errors['lang1']) : ?>
			<td class="err">Please enter a language.</td>
<?php endif; ?>
<?php if ($errors['lang1s']) : ?>
			<td class="err">Please select at least one.</td>
<?php endif; ?>
		</tr>
		<tr>
			<th><input <?php if ($errors['lang2']) {echo "class=e ";} ?>type="text" name="lang2" <?php if ($lang2) { echo "value=\"$lang2\" "; } ?>/></td>
			<th<?php if ($errors['lang2s']) {echo " class=e";} ?>><input type="checkbox" name="lang2speak" value="Speak and Understand" <?php if ($lang2speak) { echo "checked=\"checked\" "; } ?> /> Speak and Understand</th>
			<th<?php if ($errors['lang2s']) {echo " class=e";} ?>><input type="checkbox" name="lang2read" value="Read and Translate" <?php if ($lang2read) { echo "checked=\"checked\" "; } ?> /> Read and Translate</th>
			<th<?php if ($errors['lang2s']) {echo " class=e";} ?>><input type="checkbox" name="lang2write" value="Write" <?php if ($lang2write) { echo "checked=\"checked\" "; } ?> /> Write</th>
<?php if ($errors['lang2']) : ?>
			<td class="err">Please enter a language.</td>
<?php endif; ?>
<?php if ($errors['lang2s']) : ?>
			<td class="err">Please select at least one.</td>
<?php endif; ?>
		</tr>
		</table>
	</div>

	<div id="sectend">
		<div id="buttons">
			<input class="fbtn" type="submit" name="submit" value="Send Form" />
			<input class="fbtn" type="reset" name="reset" value="Clear Form" />
			<input class="fbtn" type="submit" name="cancel" value="Cancel" />
		</div>
	</div>

	</form>
</div><!-- end signup -->
</div><!-- end result -->
<?php endif; ?>

 

 

And here's a VIEW SOURCE of the FORM ONLY with ERRORS (class="e"):

 

	<div id="result">
<div id="signup">
	<form name="signupform" method="post" action="#result">
	<h3>Volunteer Sign-Up Form</h3>

	<div id="byline">Fields with a <b>Bold Label</b> are required.</div>
	<div id="errmsg">
		Please correct fields highlighted in pink.
	</div>

	<div class="sect1">
		<h4>Have you volunteered for Hanson EDS before?:</h4>

		<table class="w75">
		<tr>
			<th class="w20"><input id="edsyes" type="radio" name="edsyesno" value="I have already volunteered for Hanson EDS"  onClick="ableEDS();" /> Yes</th>
			<th><input id="steering" type="checkbox" name="steering" value="I am a member of the Steering Committee"  disabled="true" /> I am a member of the Steering Committee</th>
		</tr>
		<tr>
			<th class="w20"><input id="edsno" type="radio" name="edsyesno" value="I have NOT volunteered for Hanson EDS before" checked="checked"  onClick="ableEDS();" /> No</th>
			<th>My assigned position:   <input id="position" type="text" name="position"  disabled="true" /></th>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Name:</h4>
		<table>

		<tr>
			<th class="r e">First Name:</th>
			<td><input class="e" type="text" name="firstname" /></td>
			<th class="r e">Last Name:</th>
			<td><input class="e" type="text" name="lastname" /></td>
			<th>Middle Initial:</th>
			<td><input type="text" name="initial" size="1" maxlength="1" /></td>

		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Address:</h4>
		<table>
		<tr>
			<th class="r e">Street:</th>
			<td><input class="e" type="text" name="street" /></td>
			<th class="r">City:</th>
			<td><input type="text" name="city" value="Hanson" /></td>
			<th>State:</th>
			<td><input type="text" name="state" size="2" maxlength="2" value="MA"  /></td>
			<th class="r">Zip:</th>
			<td><input type="text" name="zip" size="5" maxlength="5" value="02341" /></td>

		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Phone and Email</h4>
		<table>
		<tr>
			<th class="r e">Home:</th>
			<td><input class="e" type="text" name="phone" /></td>
			<th>Work:</th>
			<td><input type="text" name="workphone" /></td>
			<th>Cell:</th>
			<td><input type="text" name="cellphone" /></td>
		</tr>
		<tr>
			<th>Email:</th>
			<td colspan="5"><input type="text" name="email" size="54" /></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Preferred Contact Method</h4>
		<table>
		<tr>
			<th><input type="checkbox" name="prefhome" value="Please contact me by Home Phone"  /> Home Phone</th>
			<th><input type="checkbox" name="prefwork" value="Please contact me by Work Phone"  /> Work Phone</th>
			<th><input type="checkbox" name="prefcell" value="Please contact me by Cell Phone"  /> Cell Phone</th>
			<th><input type="checkbox" name="prefemail" value="Please contact me by Email"  /> Email</th>
		</tr>

		</table>
	</div>

	<div class="sect">
		<h4>Personal Data</h4>
		<table>
		<tr>
			<th class="r e">DOB (mm/dd/yy):</th>
			<td><input type="text" class="e" name="dobmm" size="1" />/<input class="e" type="text" name="dobdd" size="1" maxlength="2" />/<input class="e" type="text" name="dobyy" size="1" maxlength="2" /></td>
			<th>SSN:</th>
			<td><input type="text" name="ssn1" size="2" maxlength="3" />-<input type="text" name="ssn2" size="1" maxlength="2" />-<input type="text" name="ssn3" size="3" maxlength="4" /></td>
			<th>Driver's License:</th>
			<td><input type="text" name="dln" /></td>
		</tr>

		</table>
	</div>

	<div class="sect">
		<h4>Emergency Contact Information</h4>
		<table>
		<tr>
			<th class="r e">Name:</th>
			<td><input class="e" type="text" name="emername" size="40" /></td>
			<th class="r e">Address:</th>
			<td><input class="e" type="text" name="emeraddr" size="40" /></td>
		</tr>
		<tr>
			<th class="r e">Relationship:</th>
			<td><input class="e" type="text" name="emerrel" size="40" /></td>
			<th class="r e">Phone:</th>
			<td><input class="e" type="text" name="emerphone" size="40" /></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>What are you volunteering for?</h4>
		<table>
		<tr>
			<th><input type="radio" name="voltype" value="Emergency ONLY" checked="checked"  onclick="ableHours()" /> Emergency ONLY</th>
		</tr>
		<tr>
			<th><input type="radio" name="voltype" value="Emergency AND Non-Emergencies"  onclick="ableHours()" /> Emergency AND Non-Emergency</th>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Non-Emergency Hours Preferred (if applicable)</h4>
		<table>
		<tr>
			<th><input type="checkbox" name="volhoursdm" value="Weekday Mornings"  disabled="true" /> Weekday Mornings</th>
			<th><input type="checkbox" name="volhoursda" value="Weekday Afternoons"  disabled="true" /> Weekday Afternoons</th>
			<th><input type="checkbox" name="volhoursde" value="Weekday Evenings"  disabled="true" /> Weekday Evenings</th>
		</tr>
		<tr>
			<th><input type="checkbox" name="volhoursem" value="Weekend Mornings"  disabled="true" /> Weekend Mornings</th>
			<th><input type="checkbox" name="volhoursea" value="Weekend Afternoons"  disabled="true" /> Weekend Afternoons</th>
			<th><input type="checkbox" name="volhoursee" value="Weekend Evenings"  disabled="true" /> Weekend Evenings</th>

		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Volunteer Interests</h4>
		<table>
		<tr>
			<th><input type="checkbox" name="volintc" value="Clinical Work"  /> Clinical Work</th>
			<th><input type="checkbox" name="volintd" value="Deliveries"  /> Deliveries</th>
			<th><input type="checkbox" name="volintf" value="Fundraising"  /> Fundraising</th>
		</tr>
		<tr>
			<th><input type="checkbox" name="volinta" value="Administration"  /> Administration</th>
			<th><input type="checkbox" name="volinth" value="Health Education"  /> Health Education</th>
			<th><input type="checkbox" name="volintn" value="Newsletter Production"  /> Newsletter Production</th>
		</tr>
		<tr>
			<th><input type="checkbox" name="volintp" value="Phone Bank"  /> Phone Bank</th>
			<th><input type="checkbox" name="volintv" value="Volunteer Coordinator"  /> Volunteer Coordinator</th>
			<th><input type="checkbox" name="volints" value="Security"  /> Security</th>

		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Professional/Volunteer Experience</h4>
		<table>
		<tr>
			<th class="center">Organization</th>
			<th class="center">Dates</th>
			<th class="center">Position</th>
			<th class="center">Responsibilities</th>
		</tr>
		<tr>
			<td><input type="text" name="exporg1" /></td>
			<td><input type="text" name="expdates1" /></td>
			<td><input type="text" name="exppos1" /></td>
			<td><input type="text" name="expresp1" size="36" /></td>
		</tr>
		<tr>
			<td><input type="text" name="exporg2" /></td>
			<td><input type="text" name="expdates2" /></td>
			<td><input type="text" name="exppos2" /></td>
			<td><input type="text" name="expresp2" size="36" /></td>
		</tr>

		<tr>
			<td><input type="text" name="exporg3" /></td>
			<td><input type="text" name="expdates3" /></td>
			<td><input type="text" name="exppos3" /></td>
			<td><input type="text" name="expresp3" size="36" /></td>
		</tr>
		</table>
	</div>

	<div class="sect">
		<h4>Language Fluency (in addition to English)</h4>
		<table>
		<tr>
			<th><input type="text" name="lang1" /></td>
			<th><input type="checkbox" name="lang1speak" value="Speak and Understand"  /> Speak and Understand</th>
			<th><input type="checkbox" name="lang1read" value="Read and Translate"  /> Read and Translate</th>
			<th><input type="checkbox" name="lang1write" value="Write"  /> Write</th>
		</tr>
		<tr>
			<th><input type="text" name="lang2" /></td>
			<th><input type="checkbox" name="lang2speak" value="Speak and Understand"  /> Speak and Understand</th>
			<th><input type="checkbox" name="lang2read" value="Read and Translate"  /> Read and Translate</th>
			<th><input type="checkbox" name="lang2write" value="Write"  /> Write</th>
		</tr>
		</table>
	</div>

	<div id="sectend">
		<div id="buttons">
			<input class="fbtn" type="submit" name="submit" value="Send Form" />
			<input class="fbtn" type="reset" name="reset" value="Clear Form" />
			<input class="fbtn" type="submit" name="cancel" value="Cancel" />
		</div>
	</div>

	</form>
</div><!-- end signup -->
</div><!-- end result -->

 

 

 

Thanks!

 

 

 

Link to comment
Share on other sites

I don't show BOTH success AND error on the same page at the same time.  The reason I use the #result anchor is that when there is an error, I want to reload the ENTIRE page, including the five paragraphs of explanation ABOVE the form and error message, but I want to LAND on the error message at the top of the form.

 

Without the anchor, they would have to scroll down to the next viewable screen to see that an error has occurred on the form.  Of course I could post the error message at the top of the page, but for usability reasons I chose to post it at the top of the form, where it makes sense.

 

I will try the php_self with the #result anchor on a test area in a personal domain -- unless of course anyone reads my code and comes up with something else?  Trouble is, I have no more Vista test group.  I cannot bother the people at town hall with this.  It was tough enough to ask them to test it the first time!  They were just glad that people in a different department (with "older computers," e.g. xp) could submit the form and they consider the matter settled.

 

Any Vista volunteers out there?

 

Thanks again.

 

 

Link to comment
Share on other sites

except that I know php5 does not allow full http (external) urls.

 

Php5 does not care because browsers are what form the URL that the browser requests when the form is submitted.

 

If you enter a relative URL, the browser takes the url of the current page and appends any relative URL in the action="..." parameter (this is why empty or missing action="" parameters submit to the same page.) If you enter an absolute URL in the action="..." parameter, the browser directly uses that. If you had some previous problem, it is not because of php5.

Link to comment
Share on other sites

Php5 does not care because browsers are what form the URL that the browser requests when the form is submitted.

 

If you enter a relative URL, the browser takes the url of the current page and appends any relative URL in the action="..." parameter (this is why empty or missing action="" parameters submit to the same page.) If you enter an absolute URL in the action="..." parameter, the browser directly uses that. If you had some previous problem, it is not because of php5.

 

Right.  Sorry.

 

I was thinking of allow_url_include is defaulted to "off" in PHP5 which means

 

This will NOT work: include(http://mysite.com/inc/header.php)

But this WILL work: include (/inc/header.php)

 

Also, relative path has a huge problem in PHP5.  So if I'm in a subfolder called "demos" and I want to include something from the "inc" folder

 

This will NOT work: include(../inc/header.php)

 

I've googled some stuff about the bug, but no fixes as of yet that I know of.  I do not have access to ini files on my server.  I am a host reseller tho.  Anything I can put in .htaccess to rectify this?

 

I know this post belongs in a different topic/category.  But hey, you seem to know what you're talking about, so I thought I'd take this opportunity to ask.

 

 

Link to comment
Share on other sites

Just out of curiousoity, why not use action="<?php $_SERVER['PHP_SELF']; ?>"?

I see you have given the submit button a name, and you're then checking if the post data if submitted. Using PHP_SELF would probably be more sensible.

 

if ($errmsg || !isset($_POST["submit"]))

 

 

What i would do: (Extremely basic for example purposes)

 

<?php
if(isset($_POST['submit']) {
  // Write to database or something similar OR show confirmation page?
} 
else if(isset($_POST['cancel']) {
  // Go to the cancellation page?
}
else if($errmsg) {
  // Show errors?
}
else {
  // Show sign-up form?
}
?>

 

 

Link to comment
Share on other sites

Don't assume this is a Vista problem without checking what they are using.

 

I put your form code into a valid html document and there are a few validation errors that could cause the form to be valid in one browser and not another.

 

Check your whole actual pages using - http://validator.w3.org/ and any CSS using http://jigsaw.w3.org/css-validator/

 

I see that you have some javascript on the form: onClick="ableEDS();"  It could very well be that they have javascript disabled. Does this javascript code affect if or how the form is submitted?

 

This could also be something like HTTP_REFERER being empty and the code you cut from the post expecting it to have a value.

 

It would take seeing all your form processing code to directly be able to help with what it is doing.

 

To determine what the actual problem is (Vista or something else), someone would need to take your form, and submit it to some code that dumps what is actually being submitted and check if any of your form processing code is expecting something that is not present and then find out why that something is missing.

Link to comment
Share on other sites

Hi, yes, normally I never publish anything that does not validate in w3c, but they were in a big hurry for this form so I kind of slapped it together, knowing full well it would not validate.  Plus, the author is the "TOWN OF mytown" not, me, and there is no link to my website or portfolio. :)

 

But I DID run it through w3c validation anyway, and I was satisfied that the types of errors would not alter the functionality of the form.  The plan was to put the form up live NOW cuz they needed it immediately, and then correct those annoying little typo errors later.

 

The javascript is not essential; it just disables or enables some of the form fields based on "yes" or "no" radio buttons.

 

The reason I am assuming the problem is VISTA is because the FORM WORKS PERFECTLY FINE for EVERYONE ELSE who has tested it, both pc and mac.  I personally tested it on three different configurations - 2pc and 1mac, and I had 8 other people test it.  The ONLY person it did NOT work for was the seventy-year-old health agent in the town hall office using his "brand new computer."  I assume he is running Vista not only b/c his puter is brand new, but also b/c he said that this computer had LOTS OF PROBLEMS.  Sounds like Vista to me.

Link to comment
Share on other sites

Every Windows computer has lots of problems. =)

And do you want me to try it on my box?  Ubuntu w/ Firefox 3 Beta 5.  And we all know that Microsoft sucks at following standards, so go have fun with Google for a bit and look up Vista's IE7 quirks.

Link to comment
Share on other sites

The missing/miss-matched tags in the table are what I was referring to. Some browsers don't see form elements contained in broken tags in a table.

 

Also, if the invalid disabled="true" tags are dependent on the javascript to become valid and the two people where this does not work have javascript turned off, than that is more invalid html the browser will need to deal with.

 

I seriously recommend valid html.

Link to comment
Share on other sites

OK Fine.  Yes, I know I closed some of my <th> tags with </td> instead of </th>.  It didn't make a difference in 11/13 tests, and on the two "probably Vista" computers at town hall that failed, I seriously doubt that was the problem.  Most likely if <th></td> was a problem, it would be a RENDERING problem, not a forms processing problem.

 

My page now validates xhtml 1.1 in w3c and I have changed the action from action="#result" to action="<?php $_SERVER['PHP_SELF'] ?>#result", which I'm almost positive was the problem.  The form still works perfectly on my three computers.  Now I just need someone with Vista to test it.

 

No Vista users out there anywhere?

 

PFMaBiSmAd - Any thoughts on my allow_url_include comment above?

 

 

Link to comment
Share on other sites

You're being ignorant, sorry to be direct, i don't mean no offence. However, there is clearly an issue with YOUR code, not explicity a vista compatilibity issue. You cannot justify your argument based soley upon the operating system. Because in effect, PHP is a server side language and is in no way effected by the client operating system.

 

My advice to you would be to re-write your entire code, start off with something simple. Maybe an input box or 2, test it and continue. Trial and error is the key to progress, i strongly recommend you look into more effecient coding strategies also.

I'm running Vista now, and with more than capable hardware I haven't experienced any issues, Desktop development or website development wise.

 

Why are you so persistant in using #result?

 

 

P.S, no offensive statements intended.

Link to comment
Share on other sites

Not to be rude mate but this has nothink to do with php it your mashed up html................

 

 

you tell us all how your code controlls os systems were all be rich..............

 

post your new formated code then, let me see it please.............

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.