I’m looking for alternative ways of use for import_request_variables, I seen extract is something I can do but I cannot get it to work properly… That is assuming I’m doing it right…
Below is my code:
[php]
#volunteer form * { font-family: sans-serif; font-size: 20px !important; } #volunteer form h1, h1 * { font-size: 30px !important; } #volunteer form h2 { font-size: 25px; } #volunteer form table.fillin input { border: none; border-bottom: 1px solid black; float: left; padding: 1px 3px; } #volunteer form input.fullsize { width: 40em; } #volunteer form input.halfsize { width: 15em; } #volunteer form input.quartersize { width: 7.5em; } #volunteer form input#state_field { width: 4em; } #volunteer form table.fillin th { text-align: right; } #volunteer form table.fillin td { text-align: left; } #volunteer form hr { border: none; border-bottom: 2px dashed black; } #volunteer form table.check { vertical-align: top; } #volunteer form address { font-style: normal; margin-left: 10em; }$target_email = "[email protected]";
$target_subject = “VOLUNTEER SUBMISSION”;
$from_address = “[email protected]”;
/* No user-servicable parts inside. */
/* http://php.net/import_request_variables */
import_request_variables(“p”, “posted_”);
$mail_format = <<<MAILFORMAT
Name: $posted_name_field
Address: $posted_address_field
City: $posted_city_field
State: $posted_state_field
County: $posted_county_field
ZIP: $posted_zip_field
Home Phone: $posted_homephone_field
Mobile Phone: $posted_mobilephone_field
E-mail: $posted_email_field
He/she is willing to:
[$posted_election_field] Circulate Petitions
[$posted_volunteer_field] Volunteer at events
[$posted_recruit_field] Help recruit other volunteers
[$posted_yardsigns_field] Put up Yard Signs
[$posted_endorse_field] Use my Name to Endorse
[$posted_phone_field] Make Phone Calls
[$posted_fundraise_field] Fundraise / Host Events
[$posted_letters_field] Write letters to the Editor
[$posted_helpinoffice_field] Help in Office / Data Entry
Comments/Interests:
$posted_comments_field
Form submitted %s from IP %s.
MAILFORMAT;
$mail_text = sprintf($mail_format, date(DATE_RFC822), $_SERVER[‘REMOTE_ADDR’]);
if ($posted_name_field) {
/* send_mail() returns false if there is a failure */
if (mail($target_email, $target_subject, $mail_text, “From: $from_address”)) {
print “
Sent! Thank you for your response!
Content of message:
$mail_text”;
exit();
} else {
print “
Failure when sending message!
Please notify <a href=“mailto:$target_email”>$target_email of this issue
”;}
} else {
$show_form = 1;
}
/* Show the form if we have to. */
if ($show_form == 1) {
?>
YES! I want to volunteer to help the
Committee
<div align="center">
<p>All Information is required. (except Mobile)</p>
<table width="663" class="fillin">
<tr><td width="639" height="89"><div align="center">
<table border='0'><tr><td>Name :</td><td>
<input class="halfsize" id="name_field" name="name_field" type="text" />
</td><td>Address:</td><td>
<input class="halfsize" id="address_field" name="address_field" type="text" />
</td><td>City :</td><td>
<input class="halfsize" id="city_field" name="city_field" type="text" />
</td></tr><tr><td>County:</td><td>
<input class="halfsize" id="city_field2" name="county_field" type="text" />
</td><td> State :</td><td>
<input name="state_field" type="text" id="state_field" />
</td><td> ZIP :</td><td>
<input name="zip_field" type="text" class="quartersize " id="zip_field" />
</td></tr><tr><td>
Home:</td><td>
<input class="halfsize" id="homephone_field" name="homephone_field" type="text" />
</td><td>Mobile :</td><td>
<input name="mobilephone_field" type="text" class="check " id="mobilephone_field" />
</td><td>E-mail:</td><td>
<input class="halfsize" id="email_field" name="email_field" type="text" />
</td></tr></table>
<p> </p>
</div>
</td>
</tr>
</table>
<br />
</div>
<h2 align="center">I am willing to (check all that apply):</h2>
<div align="center">
<table class="check">
<tr><td width="272">
<input id="election_field" name="election_field" type="checkbox" />
<label for="election_field">Circulate Petitions</label>
<br />
<input id="volunteer_field" name="volunteer_field" type="checkbox" />
<label for="volunteer_field">Volunteer at events</label>
<br />
<input id="recruit_field" name="recruit_field" type="checkbox" /> <label for="recruit_field">Help recruit other volunteers</label>
<br />
<input id="yardsigns_field" name="yardsigns_field" type="checkbox" /> <label for="yardsigns_field">Put up Yard Signs</label>
<br>
<input id="endorse_field" name="endorse_field" type="checkbox" />
Use my Name to Endorse<br />
</td><td width="18"> </td>
<td width="381">
<input id="phone_field" name="phone_field" type="checkbox" /> <label for="phone_field">Make phone calls</label>
<label for="door2door_field"></label>
<br />
<input id="fundraise_field" name="fundraise_field" type="checkbox" />
<label for="fundraise_field">Fundraise</label>
/ Host Events<br />
<input id="letters_field" name="letters_field" type="checkbox" />
Write letters to the editor<br>
<input id="helpinoffice_field" name="helpinoffice_field" type="checkbox" />
Help with Office Mailings / Data Entry
<br /> </td></tr>
</table>
<br />
<br />
<b>Comments/Interests:</b><br />
<textarea name="comments_field" cols="70" rows="10" class="check" id="comments_field"></textarea>
<br />
<br />
<input type="submit" value="SUBMIT" />
</div>