Jump to content

Codeman0013

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by Codeman0013

  1. Hey guys the following code is supposed to alternate colors on a q and a thing but for some reason its not working? I took this page over and i'm still trying to get all the bugs worked out here is the code: <?php if ($totalRows_rs_employeeinfo > 0) { // Show if recordset not empty ?><?php while (!$rs_employeeqa->EOF) {?> <tr class=" <?phpif($SSAdv_m1%$SSAdv_change_every1==0 && $SSAdv_m1>0){$SSAdv_k1++;}print $SSAdv_colors1[$SSAdv_k1%count($SSAdv_colors1)];$SSAdv_m1++;?>"> <td valign="top" width="175"><p><b><?php echo $rs_employeeqa->Fields('staffquestion'); ?></b></p></td> <td valign="top"><p><?php echo $rs_employeeqa->Fields('staffanswer'); ?></p></td> </tr> <?php $rs_employeeqa->MoveNext(); }?><?php } // Show if recordset not empty ?><?php if ($totalRows_rs_employeeqa == 0) { // Show if recordset empty ?>
  2. Codeman0013

    url problems

    Ok here is my thing i have done some error testing and found it has somethign to do with how the information is being taken from the url if i set a default value it works fine but if i dont then it shows up blank can anyone trouble shoot the following code and see if i'm pulling from the url wrong? // begin Recordset$colname__rs_employeeinfo = '1';if (isset($HTTP_GET_VARS['employeeID'])) { $colname__rs_employeeinfo = $HTTP_GET_VARS['employeeID'];}$query_rs_employeeinfo = sprintf("SELECT * FROM employees WHERE employeeID = %s", GetSQLValueString($colname__rs_employeeinfo, "int"));$rs_employeeinfo = $befh->SelectLimit($query_rs_employeeinfo) or die($befh->ErrorMsg());$totalRows_rs_employeeinfo = $rs_employeeinfo->RecordCount();// end Recordset// begin Recordset$colname__rs_employeeqa = '-1';if (isset($HTTP_GET_VARS['employeeID'])) { $colname__rs_employeeqa = $HTTP_GET_VARS['employeeID'];}$query_rs_employeeqa = sprintf("SELECT * FROM staffanswers, staffquestions WHERE staffanswers.employeeID = %s AND staffanswers.staffquestionID = staffquestions.staffquestionID", GetSQLValueString($colname__rs_employeeqa, "int"));$rs_employeeqa = $befh->SelectLimit($query_rs_employeeqa) or die($befh->ErrorMsg());$totalRows_rs_employeeqa = $rs_employeeqa->RecordCount();// end Recordset
  3. Here is my delimma the webpage should pull all of the information from the database and it does not show anything on the page. Not even the employee's name. Also dreamweaver doesnt recognize it its really annoying sheesh if anyone can help i will be happy(yes i know the connection is commented out) <?php//Connection statement//require_once('../../Connections/befh.php');// begin Recordset$colname__rs_employeeDetail = '1';if (isset($HTTP_GET_VARS['employeeID'])) { $colname__rs_employeeDetail = $HTTP_GET_VARS['employeeID'];}$query_rs_employeeDetail = sprintf("SELECT staffquestions.staffquestion, staffanswers.staffanswer FROM staffquestions, staffanswers WHERE staffanswers.employeeID = %s AND staffanswers.staffquestionID = staffquestions.staffquestionID", $colname__rs_employeeDetail);$rs_employeeDetail = $befh->SelectLimit($query_rs_employeeDetail) or die($befh->ErrorMsg());$totalRows_rs_employeeDetail = $rs_employeeDetail->RecordCount();// end Recordset// begin Recordset$colname__rs_employeePhoto = '-1';if (isset($HTTP_GET_VARS['employeeID'])) { $colname__rs_employeePhoto = $HTTP_GET_VARS['employeeID'];}$query_rs_employeePhoto = sprintf("SELECT * FROM employees WHERE employeeID = %s", $colname__rs_employeePhoto);$rs_employeePhoto = $befh->SelectLimit($query_rs_employeePhoto) or die($befh->ErrorMsg());$totalRows_rs_employeePhoto = $rs_employeePhoto->RecordCount();// end Recordset$SSAdv_colors1 = array("RowOdd","RowEven");$SSAdv_k1 = 0;$SSAdv_m1 = 0;$SSAdv_change_every1 = 1;//PHP ADODB document - made with PHAkt 2.7.1?>
  4. hey i have a mailer page and it either displays array or skips the field occupation all togethor here is my code any one that can help me would be greatly appreciated... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>Illinois Soybean Association Membership Application</title><meta name="description" content="" /><meta name="keywords" content="" /><link href="../../_lib/global.css" rel="stylesheet" type="text/css" media="screen" /><link href="../../_lib/selectors.css" rel="stylesheet" type="text/css" media="screen" /><script language="JavaScript" type="text/javascript" src="../_lib/ilSoyJavascript.js"></script></head><body><!-- HEADER --><!--ZOOMSTOP--><?php require("../../_inc/header.php"); ?><!-- END OF HEADER --><div id="body"> <div id="left"> <div id="navContainer"> <ul id="nav"> <li><a href="/about/">ABOUT</a></li> <li class="hi"><a href="/membership/">MEMBERSHIP</a></li> <li> <ul> <li><a href="/membership/soy-connect/">SoyConnect</a></li> <li class="select"><a href="/membership/application/">Membership Application</a></li> </ul> </li> <li><a href="/soybean-uses/">SOYBEAN USES</a></li> <li><a href="/education/">EDUCATION</a></li> <li><a href="/soy-news/">SOY NEWS</a></li> <li><a href="/resources/">RESOURCES</a></li> <li><a href="/directors/">DIRECTORS</a></li> <li><a href="/contact/">CONTACT</a></li> </ul> </div> <div id="navBg"></div> </div> <div id="content"> <div id="center"> <p id="breadcrumbs"><a href="/">Home</a> » <a href="/membership/">Membership</a> » <a href="/membership/application/">Application</a> » <a href="/membership/application/verify.php" class="select">Confirm Application </a> <!--ZOOMRESTART--> <h2>Please Confirm Your Information:</h2><table> <?phpforeach($_POST as $key){ $_POST[$key] = stripslashes(trim(str_replace("'","",$_POST[$key])));}print "<tr><td>Date: </td><td> $_POST[fielddate]</td></tr>";print "<tr><td>Name: </td><td> $_POST[fieldname]</td></tr>";print "<tr><td>Farm Name: </td><td> $_POST[fieldfarmname]</td></tr>";print "<tr><td>Spouse Name: </td><td> $_POST[fieldspousename]</td></tr>";print "<tr><td>Address: </td><td> $_POST[fieldaddress]</td></tr>";print "<tr><td>City: </td><td> $_POST[fieldcity]</td></tr>";print "<tr><td>State: </td><td> $_POST[fieldstate]</td></tr>";print "<tr><td>Zip: </td><td> $_POST[fieldzip]</td></tr>";print "<tr><td>County:</td><td> $_POST[fieldcounty]</td></tr>";print "<tr><td>Phone: </td><td> $_POST[fieldphone]</td></tr>";print "<tr><td>Email:</td><td> $_POST[fieldemail]</td></tr>";print "<tr><td>Age: </td><td> $_POST[Age]</td></tr>";print "<tr><td>Occupation: </td><td> ";for ($i=0;$i<count($_POST['fieldoccupation']);$i++) { print $_POST['fieldoccupation'][$i] . "<br>\n";} print "</td></tr>"; print "<tr><td>Do you want to receive the Illinois Soybean Review?:</td><td> $_POST[Review]</td></tr>";print "<tr><td>Acres farmed: </td><td> $_POST[fieldacres]</td></tr>";print "<tr><td>Soybean acres: </td><td> $_POST[fieldsoybeanacres]</td></tr>";print "<tr><td>Type of membership: </td><td> $_POST[Membership]</td></tr>";for ($i=0;$i<count($_POST['fieldoccupation']);$i++) { print "<input type=\"hidden\" name=\"fieldoccupation[]\" value=\"".$_POST['fieldoccupation'][$i] . "\"/>\n";} foreach($_POST as $key){ print "<input type=\"hidden\" name=\"$key\" value=\"$_POST[$key]\" />";} ?></table><form action="/membership/application/mailapp.php" method="post"><input type="hidden" name="fielddate" value="<?php echo $_POST['fielddate']?>"><input type="hidden" name="fieldname" value="<?php echo $_POST['fieldname']?>"><input type="hidden" name="fieldfarmname" value="<?php echo $_POST['fieldfarmname']?>"><input type="hidden" name="fieldspousename" value="<?php echo $_POST['fieldspousename']?>"><input type="hidden" name="fieldaddress" value="<?php echo $_POST['fieldaddress']?>"><input type="hidden" name="fieldcity" value="<?php echo $_POST['fieldcity']?>"><input type="hidden" name="fieldstate" value="<?php echo $_POST['fieldstate']?>"><input type="hidden" name="fieldzip" value="<?php echo $_POST['fieldzip']?>"><input type="hidden" name="fieldcounty" value="<?php echo $_POST['fieldcounty']?>"><input type="hidden" name="fieldphone" value="<?php echo $_POST['fieldphone']?>"><input type="hidden" name="fieldemail" value="<?php echo $_POST['fieldemail']?>"><input type="hidden" name="Age" value="<?php echo $_POST['Age']?>"><input type="hidden" name"occupation" value="<?php echo $_POST['fieldoccupation[]']?>" ><input type="hidden" name="Review" value="<?php echo $_POST['Review']?>"><input type="hidden" name="fieldacres" value="<?php echo $_POST['fieldacres']?>"><input type="hidden" name="fieldsoybeanacres" value="<?php echo $_POST['fieldsoybeanacres']?>"><input type="hidden" name="Membership" value="<?php echo $_POST['Membership']?>"><input type="submit" name="submit" value="Send Email"><input type="button" value="Edit Info" onclick="history.back(-1)"></form> </div> <div id="right"> <div class="blue"> <h2>Membership Dues</h2> <p>$80 for one year<br /> $195 for three years </p> </div> <!-- JOIN --> <!--ZOOMSTOP--> <?php require("../../_inc/join.php"); ?> <!-- END JOIN --> </div> <br clear="both" /><!-- FOOTER --> <?php require("../../_inc/footer.php"); ?> <!-- END OF FOOTER --> </div></div></body></html> and the mailer page <!--ZOOMSTOP--><?php// Set things up here$date = $_POST['fielddate'];$name = $_POST['fieldname'];$farmname = $_POST['fieldfarmname'];$spousename = $_POST['fieldspousename'];$address = $_POST['fieldaddress'];$city = $_POST['fieldcity'];$state = $_POST['fieldstate'];$zip = $_POST['fieldzip'];$county = $_POST['fieldcounty'];$phone = $_POST['fieldphone'];$email = $_POST['fieldemail'];$age = $_POST['Age'];$occupation = explode ("|", $_POST['fieldoccupation']);$review = $_POST['Review'];$acres = $_POST['fieldacres'];$soybeans = $_POST['fieldsoybeanacres'];$membership = $_POST['Membership'];$to = 'isintern@jonesthomas.com';$headers = 'From: ilsoy'. $subject = 'Illinois Soybean Association Membership Application';// Start the message$message = "Hello the following person has requested to join the Illinois Soybean Association\nDate: $date\nName: $name\nFarm Name: $farmname\nSpouse Name: $spousename\nAddress: $address\nCity: $city\nState: $state\nZip: $zip\nCounty: $county\nPhone: $phone\nEmail: $email\nAge: $age\nOccupation: $occupation\nDo you want to receive the Illinois Soybean Review?: $review\nAcres farmed: $acres\nSoybean acres: $soybeans\nPlease choose your membership: $membership\n";print_r($_POST);exit(); // Finally send it off.//if(mail($to, $subject, $message, $headers))//{ // header("Location: /membership/application/thankyou.php");//}//else//{ // header("Location: /membership/application/");//}?> please help me i'm stuckk...
  5. hey can someone look at this code for me and possibly tell me why since i added the email in now the checkbox does not work but the email does and if i take email off or put check box first it works?? function validateInputs3() { if (document.frmsignup.fielddate.value == "") { alert("Please enter the Date"); document.frmsignup.fielddate.focus(); return false; } else if (document.frmsignup.fieldname.value == "") { alert("Please enter your Name"); document.frmsignup.fieldname.focus(); return false; } else if (document.frmsignup.fieldfarmname.value == "") { alert("Please enter your Farm Name"); document.frmsignup.fieldfarmname.focus(); return false; } else if (document.frmsignup.fieldspousename.value == "") { alert("Please enter your Spouses Name"); document.frmsignup.fieldspousename.focus(); return false; } else if (document.frmsignup.fieldaddress.value == "") { alert("Please enter your Address"); document.frmsignup.fieldaddress.focus(); return false; } else if (document.frmsignup.fieldcity.value == "") { alert("Please enter your City"); document.frmsignup.fieldcity.focus(); return false; } else if (document.frmsignup.fieldstate.value == "") { alert("Please enter your State"); document.frmsignup.fieldstate.focus(); return false; } else if (document.frmsignup.fieldzip.value == "") { alert("Please enter your Zip Code"); document.frmsignup.fieldzip.focus(); return false; } else if (isNaN(document.frmsignup.fieldzip.value) == true) { alert("Zip Code must be a 5 digit number"); document.frmsignup.fieldzip .select(); return false; } else if (document.frmsignup.fieldcounty.value == "") { alert("Please enter your County"); document.frmsignup.fieldcounty.focus(); return false; } else if (document.frmsignup.fieldphone.value == "") { alert("Please enter your Phone Number"); document.frmsignup.fieldphone.focus(); return false; } {var emailID=document.frmsignup.fieldemail if ((emailID.value==null)||(emailID.value=="")){ alert("Please Enter A Correct Email Address") emailID.focus() return false } if (echeck(emailID.value)==false){ emailID.value="" emailID.focus() return false } return true } {var Ckfieldoccupation = false; for (var i=0; i < document.frmsignup.fieldoccupation.length; i++) { if (document.frmsignup.fieldoccupation[i].checked) { Ckfieldoccupation = true; } } if (!Ckfieldoccupation){ alert('You must select at least one of the occupations'); return false; } return true;} }
  6. Hey i have a start on teh radio button's but they dont seem to verify and i have no idea how to even approach the check box does any one have a place i can look at example or check box verification and also here is my code for the radio button if someone wants to debug it i would really appreciate it..! function validateInputs2(){ var fieldradMeet = false; var fieldradMeet; for (var i=0; i < document.frmsignup.fieldradMeet.length; i++) { if (document.frmsignup.fieldradMeet[i].checked) { fieldradMeet = true; fieldradMeet = document.frmsignup.fieldradMeet[i].value }
  7. Hey guys thanks in advance my problem is that i have a page that a user enters information and clicks submit and it goes to the next page and they can view their information on that page and then click mail or cancel to go back and fix their issue problem is it just skips all the verification on the first page and goes onto the next page. If its possible with javascript i would like to tell this page on the form instead of how i have it now have the form run just the javascript and have the javascript direct them to the next page if there are no errors on the page... please help me if you can i would be very thankful! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>Illinois Soybean Association Rust Watchers</title><meta name="description" content="" /><meta name="keywords" content="" /><link href="../../../../_lib/global.css" rel="stylesheet" type="text/css" media="screen" /><link href="../../../../_lib/selectors.css" rel="stylesheet" type="text/css" media="screen" /><script><!-- function contactCheck(){ var errors; errors=""; if (SignUpForm.fieldname.value==""){ errors+="Your Name is required."; } if (SignUpForm.fieldaddress.value==""){ errors+="Your address is required."; } if (SignUpForm.fieldcity.value==""){ errors+="Your City is required."; } if (SignUpForm.fieldstate.value==""){ errors+="Your State is required."; } if (SignUpForm.fieldzip.value==""){ errors+="Your Zip Code is required."; } if (SignUpForm.fieldphone.value==""){ errors+="Your Phone Number is required."; } if (echeck(SignUpForm.fieldemail.value)!=true){ errors+="\nYou must enter a valid email address."; } if (errors==""){ SignUpForm.method="POST"; SignUpForm.submit(); } else { alert(errors); } } //Check E-mail quality function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false } if (str.indexOf(at,(lat+1))!=-1){ return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false } if (str.indexOf(dot,(lat+2))==-1){ return false } if (str.indexOf(" ")!=-1){ return false } return true } //--> </script></head><body><!-- HEADER --><?php require("../../../../_inc/header.php"); ?><!-- END OF HEADER --><div id="body"> <div id="left"> <div id="navContainer"> <ul id="nav"> <li class="select"><a href="/about/">ABOUT</a></li> <li> <ul> <li><a href="/about/research/">Research</a></li> <li><a href="/about/legislature/">Legislature</a></li> <li><a href="/about/international-marketing/">International Marketing</a></li> <li class="select"><a href="/about/programs/index.php">Programs</a></li> </ul> </li> <li><a href="/membership/">MEMBERSHIP</a></li> <li><a href="/soybean-uses/">SOYBEAN USES</a></li> <li><a href="/education/">EDUCATION</a></li> <li><a href="/soy-news/">SOY NEWS</a></li> <li><a href="/resources/">RESOURCES</a></li> <li><a href="/directors/">DIRECTORS</a></li> <li><a href="/contact/">CONTACT</a></li> </ul> </div> <div id="navBg"></div> </div> <div id="content"> <div id="center"> <p id="breadcrumbs"><a href="/">Home</a> » <a href="/about/">About</a> » <a href="/about/programs">Programs</a> » <a href="/about/programs/rust-watchers/">Rust Watchers</a> » <a href="index.php" class="select">Application</a></p> <h2>Soybean Rust Watcher Sign-Up</h2> <img src="../../../../_img/defendYourYieldslogo.jpg" vspace="5" hspace="5" height="100" width="100" align="middle" /><FORM Method="Post" Action="verify.php" id=form2 name="SignUpForm" onsubmit="contactCheck()"> <table> <tr> <td>Name:</td> <td><input type="text" name="fieldname"></td> </tr> <tr> <td>Address:</td> <td><input type="text" name="fieldaddress"></td> </tr> <tr> <td>City:</td> <td><input type="text" name="fieldcity"></td> </tr> <tr> <td>State:</td> <td><input type="text" name="fieldstate"></td> </tr> <tr> <td>Zip Code:</td> <td><input type="text" name="fieldzip"></td> </tr> <tr> <td>Phone:</td> <td><input type="text" name="fieldphone"></td> </tr> <tr> <td>Fax:</td> <td><input type="text" name="fieldfax"></td> </tr> <tr> <td>E-Mail:</td> <td><input type="text" name="fieldemail"></td> </tr> <tr> <td></td> <td><Input Type="Submit" Name="button" Value="Submit Application" onclick="contactCheck();"> </td> </tr> </table> </form> </div> <div id="right"> <div class="blue"> <h4>Program Sections</h4> <ul> <li><a href="/about/programs/soybean-quality/">The Soybean Quality Rewards Program</a></li> <li><a href="/about/programs/rust-watchers/">Rust Watchers</a></li> <li><a href="/about/programs/soyleaders/">SoyLeaders</a></li> <li><a href="/about/programs/speakers-bureau/">Speakers Bureau</a></li> </ul> </div> </div> <br clear="both" /><!-- FOOTER --> <?php require("../../../../_inc/footer.php"); ?> <!-- END OF FOOTER --> </div></div></body></html>
  8. its not specifying the to address at all thats just the person submiting their email for future reference if needed there is no place where they put their to address the script does it all but right now its not calling the information on the page needed to send it to the email page its just simply printing it and i'm having issues with it and i dont know if i will ever get it working...<?phpforeach($_POST as $key){ $_POST[$key] = stripslashes(trim(str_replace("'","",$_POST[$key])));}print "Name: $_POST[fieldname]<br/>";print "Address: $_POST[fieldaddress]<br/>";print "City: $_POST[fieldcity]<br/>";print "State: $_POST[fieldstate]<br/>";print "Zip: $_POST[fieldzip]<br/>";print "Phone: $_POST[fieldphone]<br/>";print "Fax: $_POST[fieldfax]<br/>";print "Email: $_POST[fieldemail]<br/>";foreach($_POST as $key){ print "<input type=\"hidden\" name=\"$key\" value=\"$_POST[$key]\" />";}?><form action="/about/programs/rust-watchers/apply-for-rust-watchers/mailapp.php" method="post"><input type="hidden" name="fieldname" value="<?php $_POST['fieldname']?>"><input type="hidden" name="fieldaddress" value="<?php $_POST['fieldaddress']?>"><input type="hidden" name="fieldcity" value="<?php $_POST['fieldcity']?>"><input type="hidden" name="fieldstate" value="<?php $_POST['fieldstate']?>"><input type="hidden" name="fieldzip" value="<?php $_POST['fieldzip']?>"><input type="hidden" name="fieldphone" value="<?php $_POST['fieldphone']?>"><input type="hidden" name="fieldfax" value="<?php $_POST['fieldfax']?>"><input type="hidden" name="fieldemail" value="<?php $_POST['fieldemail']?>"><input type="submit" name="submit" value="Send Email"><input type="submit" name="submit" value="Edit Info"></form> i dont think its right still its not sending anything to the next page at all like it should i'm just totally lost and like i said i'm a newbie on the whole php mail thing
  9. well it does send me an email just no information in the email but blank fields so if i move that inside it it will work then?
  10. hey i removed the field name part and it still just sends me a blank email i'm going to put the new revised code up here....this is the page that sends the info over...<form action="/about/programs/rust-watchers/apply-for-rust-watchers/mailapp.php" method="post"><input type="hidden" name="name" value="$_POST['name']"><input type="hidden" name="address" value="$_POST['address']"><input type="hidden" name="city" value="$_POST['city']"><input type="hidden" name="state" value="$_POST['state']"><input type="hidden" name="zip" value="$_POST['zip']"><input type="hidden" name="phone" value="$_POST['phone']"><input type="hidden" name="fax" value="$_POST['fax']"><input type="hidden" name="email" value="$_POST['email']"><input type="submit" name="submit" value="Send Email"><input type="submit" name="submit" value="Edit Info"></form> email page its self... <?php// Set things up here$Name = $_POST['name'];$Address = $_POST['address'];$City = $_POST['city'];$State = $_POST['state'];$Zip = $_POST['zip'];$Phone = $_POST['phone'];$Fax = $_POST['fax'];$Email = $_POST['email'];$to = 'isintern@jonesthomas.com';$headers = 'From: ilsoy'. $subject = 'Rust Watchers application';// Start the message$message = "Hello the following person has requested to join Rust Watchers\nName: $name\nAddress: $address\nCity: $city\nState: $state\nZip: $zip\nPhone: $phone\nFax: $fax\nEmail: $email\n";// Finally send it off.if(mail($to, $subject, $message, $headers)){ header("Location: /about/programs/rust-watchers/");}else{ header("Location: /about/programs/rust-watchers/apply-for-rust-watchers/test2.php");}?>
  11. I have a mailer page and it should take the post information and send it in email to me all i get in the email right now are the fields like Name: with nothing after it and so on i'm going to attach my email page and my page thats sending it so you can look and hopefully someone can help me here.. <?php// Set things up here$Name = $_POST['fieldname'];$Address = $_POST['fieldaddress'];$City = $_POST['fieldcity'];$State = $_POST['fieldstate'];$Zip = $_POST['fieldzip'];$Phone = $_POST['fieldphone'];$Fax = $_POST['fieldfax'];$Email = $_POST['fieldemail'];$to = 'isintern@jonesthomas.com';$headers = 'From: ilsoy'. $subject = 'Rust Watchers application';// Start the message$message = "Hello the following person has requested to join Rust Watchers\nName: $fieldname\nAddress: $fieldaddress\nCity: $fieldcity\nState: $fieldstate\nZip: $fieldzip\nPhone: $fieldphone\nFax: $fieldfax\nEmail: $fieldemail\n";// Finally send it off.if(mail($to, $subject, $message, $headers)){ header("Location: /about/programs/rust-watchers/");}else{ header("Location: /about/programs/rust-watchers/apply-for-rust-watchers/test2.php");}?> here is the page sending the email page its info... <?phpforeach($_POST as $key){ $_POST[$key] = stripslashes(trim(str_replace("'","",$_POST[$key])));}print "Name: $_POST[fieldname]<br/>";print "Address: $_POST[fieldaddress]<br/>";print "City: $_POST[fieldcity]<br/>";print "State: $_POST[fieldstate]<br/>";print "Zip: $_POST[fieldzip]<br/>";print "Phone: $_POST[fieldphone]<br/>";print "Fax: $_POST[fieldfax]<br/>";print "Email: $_POST[fieldemail]<br/>";print "<form action=\"/about/programs/rust-watchers/apply-for-rust-watchers/mailapp.php\" action=\"POST\">";foreach($_POST as $key){ print "<input type=\"hidden\" name=\"$key\" value=\"$_POST[$key]\" />";}print "<input type=\"submit\" value=\"Submit\" /></form>";?> <form action="/about/programs/rust-watchers/apply-for-rust-watchers/mailapp.php" method="post"><input type="hidden" name="fieldname" value="$_POST['fieldname']"><input type="hidden" name="fieldaddress" value="$_POST['fieldaddress']"><input type="hidden" name="fieldcity" value="$_POST['fieldcity']"><input type="hidden" name="fieldstate" value="$_POST['fieldstate']"><input type="hidden" name="fieldzip" value="$_POST['fieldzip']"><input type="hidden" name="fieldphone" value="$_POST['fieldphone']"><input type="hidden" name="fieldfax" value="$_POST['fieldfax']"><input type="hidden" name="fieldemail" value="$_POST['fieldemail']"><input type="submit" name="submit" value="Send Email"><input type="submit" name="submit" value="Edit Info"></form>
  12. My delima is i have a page that is not using a database its just pure php and i have a php mailer page but before it mails to the person i want it to take all the information from the page and submit it to a page that will display all they typed in so they can click ok to have it mail or cancel to edit it also can i put the mailer page stuff on the page so if they click ok it will submit the mailer info i have???
  13. check out www.lafspetadoption.org/doctors/index.html thats the page i need it to be longer the bar on the right is to short.....
  14. in my css i'm trying to make my sidebar autosize based on the content div next to it isnt the code just height:auto; or do i need to do more to that?
  15. Codeman0013

    database help

    hey i have a line of code that pulls the fax number from a database but if there is no fax number there i dont want it to show the fax line how would i alter my code to say this here is the code...<?php if($row_rs_schoolbus['fax'] != "") { ?><li>Fax: <?php echo $row_rs_schoolbus['fax'];?> </li><?php } ?>
  16. would the javascript forum here be able to help me program this in ajax?
  17. i'm thinking i'm going to have to do ajax i think a 2nd submit button on the page would confuse the user grr... sometimes the easier thing end up being the hardest
  18. do you think it would be easier to have them move it and a 2nd submit button on there? or is there somewhere i can have someone help me with ajax programming becuase i have been looking at it and i'm totally lost on it
  19. well i had this all in one page but i did not know how to rewrite the query that was already made by a previous person to include a 2nd table and make it work could i simply add an update button or is it possible to make the moving buttons do that?
  20. i have heard of AJAX but i am not familular with it is it hard??? also this is an IFRAME inside of another page would it be possible to put that inside there just for that to where it does not refresh the rest of the page just hte iframe??
  21. i can do this client side where it checks and updates the database???? please show me how if its possible here are the fields in the table doctor_matrix i'm trying to update DOC_ID and DEPTCONTACT_ID those either need to be deleted and readded if its changed or added if they are adding a new one please help me if its possible
  22. now if there was only a page like this one that had the ability to do the server side stuff to i would be set but i dont see that anywhere on this page dang...
  23. it doenst really matter how its done this is a total redesign the reason for the boxes is because its updating 2 differnt tables dreamweaver didnt like it becuase when you click submit it only did the one thing and did not want to open another connection unless you know how to do this i would like to see an example of the 3rd one and maybe i can do it.... or if possible make the 2nd one work where it will do 2 at once becuase this is an iframe inside of another page if that makes any sence to you...
  24. what i have is on the left in that box its the current departments and locations that the doctor is located in and it displayes out of the doctor matrix table the right side is all of the possible departments and locations displyed from the departments contact table and what i am wanting to do is when they click either button in between the two to move from one side to another have it post back and check the database and if its been added or deleted from the left table take the appropiate action in the database...
  25. i have 2 select menu's side by side and i want when you click the button to move one from the left to the right or vice versa to check the database and update the table in teh database called doctor_matrix and it shoudl change the fields DOC_ID and DEPTCONTACT_ID either delete a field if its been deleted or add one if something was added my call right now is in vbscript its all messed up from the person that made this originally and its not working yet here is te code for the button and the code it calls.. <%' *** Edit Operations: declare variablesDim MM_editActionDim MM_abortEditDim MM_editQueryDim MM_editCmdDim MM_editConnectionDim MM_editTableDim MM_editRedirectUrlDim MM_editColumnDim MM_recordIdDim MM_fieldsStrDim MM_columnsStrDim MM_fieldsDim MM_columnsDim MM_typeArrayDim MM_formValDim MM_delimDim MM_altValDim MM_emptyValDim MM_iMM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))If (Request.QueryString <> "") ThenMM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)End If' boolean to abort record editMM_abortEdit = false' query string to executeMM_editQuery = ""%><%' *** Update Record: set variablesIf (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") ThenMM_editConnection = MM_connChristie_STRINGMM_editTable = "doctor_matrix"MM_editColumn = "DEPTCONTACT_ID"MM_recordId = "" + Request.Form("MM_recordId") + ""MM_editRedirectUrl = ""MM_fieldsStr = "CURRENTDEPT_ID|value"MM_columnsStr = "DEPTCONTACT_ID|none,none,NULL"' create the MM_fields and MM_columns arraysMM_fields = Split(MM_fieldsStr, "|")MM_columns = Split(MM_columnsStr, "|")' set the form valuesFor MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))Next' append the query string to the redirect URLIf (MM_editRedirectUrl <> "" And Request.QueryString <> "") ThenIf (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") ThenMM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryStringElseMM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryStringEnd IfEnd IfEnd If%><%' *** Update Record: construct a sql update statement and execute itIf (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then' create the sql update statementMM_editQuery = "update " & MM_editTable & " set "For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2MM_formVal = MM_fields(MM_i+1)MM_typeArray = Split(MM_columns(MM_i+1),",")MM_delim = MM_typeArray(0)If (MM_delim = "none") Then MM_delim = ""MM_altVal = MM_typeArray(1)If (MM_altVal = "none") Then MM_altVal = ""MM_emptyVal = MM_typeArray(2)If (MM_emptyVal = "none") Then MM_emptyVal = ""If (MM_formVal = "") ThenMM_formVal = MM_emptyValElseIf (MM_altVal <> "") ThenMM_formVal = MM_altValElseIf (MM_delim = "'") Then ' escape quotesMM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"ElseMM_formVal = MM_delim + MM_formVal + MM_delimEnd IfEnd IfIf (MM_i <> LBound(MM_fields)) ThenMM_editQuery = MM_editQuery & ","End IfMM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formValNextMM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordIdIf (Not MM_abortEdit) Then' execute the updateSet MM_editCmd = Server.CreateObject("ADODB.Command")MM_editCmd.ActiveConnection = MM_editConnectionMM_editCmd.CommandText = MM_editQueryMM_editCmd.ExecuteMM_editCmd.ActiveConnection.CloseIf (MM_editRedirectUrl <> "") ThenResponse.Redirect(MM_editRedirectUrl)End IfEnd IfEnd If%>
×
×
  • Create New...