All pastes #917363 Raw Edit

ed

public php v1 · immutable
#917363 ·published 2008-02-25 09:40 UTC
rendered paste body
############### PHP STYLE ########################<?php//gather var from html post. this is only for the second time this page is loaded. //this has to happen before any headers have been sent.$Fname = $_POST["Fname"];$Mname = $_POST["Mname"];$Lname = $_POST["Lname"];$Staddress = $_POST["Staddress"];$Saddress = $_POST["Saddress"];$Zaddress = $_POST["Zaddress"];$Phone = $_POST["Phone"];$email = $_POST["email"];$emailv = $_POST["emailv"];$s1 = $_POST["s1"];$s2 = $_POST["s2"];$s3 = $_POST["s3"];$s4 = $_POST["s4"];$s5c1 = $_POST["s5c1"];$s5c2 = $_POST["s5c2"];$s5c3 = $_POST["s5c3"];$s5c4 = $_POST["s5c4"];$s6 = $_POST["s6"];$s7 = $_POST["s7"];$s8 = $_POST["s8"];$s9 = $_POST["s9"];?><html><head><title>fdt_signup</title><!-- thanks to netlobo.com for the js code --><script type="text/javascript">function toggleLayer( whichLayer ){  var elem, vis;  if( document.getElementById ) // this is the way the standards work    elem = document.getElementById( whichLayer );  else if( document.all ) // this is the way old msie versions work      elem = document.all[whichLayer];  else if( document.layers ) // this is the way nn4 works    elem = document.layers[whichLayer];  vis = elem.style;  // if the style.display value is blank we try to figure it out here  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';  vis.display = (vis.display==''||vis.display=='block')?'none':'block';}//end thanks-for scriptfunction nextLayer (thislayer) {	if (thislayer="one") { toggleLayer('two');}	else if (thislayer="two") { toggleLayer('three');}	else if (thislayer="three") { toggleLayer('four');}	else if (thislayer="four") { toggleLayer('one');}}function validate_email(field,alerttxt){	with (field)	{	apos=value.indexOf("@");	dotpos=value.lastIndexOf(".");	if (apos<1||dotpos-apos<2) 	  {alert(alerttxt);return false;}	else {return true;}	}}function validate_required(field,alerttxt){	with (field)	{	  if (value=="36")	  {	  return true;	  	  }	  else	  {	  alert(alerttxt);return false;	  }	}}function validate_form(thisform){	with (thisform)	{	if (validate_email(email,"Not a valid e-mail address!")==false)	  {email.focus();return false;}	else if (validate_required(validation, "MORE HUMAN THAN HUMAN")==false)		{return false;}	else ()		{return true;}	}}</script><style type="text/css">a {		color: #000; 	font-style: inherit; 	text-decoration: none;	border: none;	padding: 10px;}a:hover { 	color: #c00; }a.underline {	text-decoration: underline;}	div#one, #two, #three, #four, #end {	margin: 0px 20px 0px 20px;  	display: none;}</style></head><body><?php// has form been submited? if not (!) then show the signup form.// remember- that if $_POST['submit'] does not evaluate to true then everything in the if statement will not execute. if (!isset($_POST['submit'])) { ?><script type="text/javascript">toggleLayer('one');</script><!-- navigation links --><a href="javascript:toggleLayer('one');" title="news">one</a><a href="javascript:toggleLayer('two');" title="news">two</a><a href="javascript:toggleLayer('three');" title="news">three</a><a href="javascript:toggleLayer('four');" title="news">four</a><div id="one"><!-- explination/checklist -->Check List: <br /><ol><li>Contact Information </li><li>Short Answer</li><li>Essay</li><li>Liability Form</li><li>Headshot</li></ol><a href="javascript:nextLayer('one');" title="next" id="next">next</a></div><!-- start form. contact info --><div id="two"><form method="post" action="<?php echo $PHP_SELF;?>" onsubmit="return validate_form(this);">First Name:<input type="text" size="12" maxlength="20" name="Fname"><br />Middle Name:<input type="text" size="12" maxlength="20" name="Mname"><br />Last Name:<input type="text" size="12" maxlength="20" name="Lname"><br />Mailing Address:<br />Street:<input type="text" size="12" maxlength="20" name="Staddress"><br />State:<input type="text" size="12" maxlength="20" name="Saddress"><br />Zip:<input type="text" size="12" maxlength="5" name="Zaddress"><br />Phone:<input type="text" size="12" maxlength="10" name="Phone"><br />Email:<input type="text" size="12" maxlength="30" name="email"><br />Email (verify):<input type="text" size="12" maxlength="30" name="emailv"><br /><a href="javascript:nextLayer('two');" title="next" id="next">next</a></div><div id="three"><h2>SHORT ANSWER:</h2><span>What do you do when you’re alone and not making art (or mastrubating):</span><textarea name="s1" rows="10" cols="45" name="s1"></textarea><span>What is your favorite brand of whiskey</span><textarea name="s2" rows="10" cols="45" name="s2"></textarea><span>Name one thing you want to do before you die.</span><textarea name="s3" rows="10" cols="45" name="s3"></textarea><span>If you could only have one possession in life what would it be</span><textarea name="s4" rows="10" cols="45" name="s4"></textarea><span>Do your nipples get hard to any of the following (please check any or all that apply) <input name="s5c1" type="checkbox" value="c2">Squirrels eating out of the trash can<input name="s5c2" type="checkbox" value="c2">Crystal balls/Gypsy grifting<input name="s5c3" type="checkbox" value="c3">Banana splits<input name="s5c4" type="checkbox" value="c4">Spaghetti westerns<span>If you were any food item what would you be? Would you eat yourself</span> <textarea name="s6" rows="10" cols="45" name="s2"></textarea><span>Name one thing you would destroy</span><textarea name="s7" rows="10" cols="45" name="s2"></textarea><span>What do you think "Future Death Toll" means?</span><textarea name="s8" rows="10" cols="45" name="s2"></textarea><span>If you were the supreme predator of the animal kingdom would you command the land/air/sea? What animal would you be? Why?</span><textarea name="s9" rows="10" cols="45" name="s2"></textarea><a href="javascript:nextLayer('three');" title="next" id="next">next</a></div><div id="four"><h2>Liability Form:</h2><i>I hereby do not hold Future death toll, futuredeathtoll.com or any of it members liable for any reason. Membership to FDT is on a voluntarily basis and if for any reason you would like to leave the group at anytime you may do so. FDT also has the right to terminate membership for any reason at anytime. FDT is an artist collective open to any artist working in any medium. FDT does not discriminate against age, race, religion, or sexual orientation. </i><br />are you human? type in how many months there are in three years.<input type="text" size="12" maxlength="10" name="validate"><input type="text" size="12" maxlength="10" name="Date" value="<?=date('F j, Y, g:i a');?>"><input type="submit" value="submit" name="submit"></form><a href="javascript:nextLayer('four');" title="next" id="next">back to one</a></div><div id="end"><?//instead of echo'ing all of the previous html just close the php tag and reopen later in file.//remember- we are are still in the in the if function.} 	else {?> <!-- begin else statement html --><script type="text/javascript">toggleLayer('end');</script><?php		echo ($Fname . 			$Mname .			$Lname.			$Staddress .			$Saddress .			$Zaddress .			$Phone .			$email .			$emailv .			$s1 .			$s2 .			$s3 .			$s4 .			$s51 .			$s52 .			$s53 .			$s54 .			$s6 .			$s7 .			$s8 .			$s9 );		//begin mysql query to dump info into db		/*		$link = mysql_connect('localhost', 'edwardsh_1', '1234')		   or die('Could not connect: ' . mysql_error());		mysql_select_db('edwardsh_db') or die('Could not select database');		$query = "INSERT INTO `blog` (id, date, title, data) VALUES ('LAST_INSERT_ID()', '$date', '$title', '$data');";		mysql_query($query) or die(mysql_error($link));		echo "added";		@mysql_free_result($result);		@mysql_close($link);		*/		//end mysql query to dump info into do	} //end else satement?> </div></body></html>