eideticmnemonic Posted April 5, 2007 Share Posted April 5, 2007 When the form is submitted, I get this message: Form Error(s): FIELD: comments -> ERROR: no data submitted. The form is at www.integrativemassageaustin.com/form/form.php I know nothing about PHP, but I'm sure the solution is quite simple. I have edited these files only minimally. Here's the code: here is config.php: <?php /* Author: Stuart Cochrane URL: www.freecontactform.com Email: [email protected] Date: 21st Feb 2007 Version: 2.5 Beta 2 Updates: Includes generic JS and PHP form validators License: Free to use and edit, but all comments and must remain intact. Link to author website MUST remain - unless you have purchased the rights to remove it!! - see README file for details. */ /* THIS IS YOUR CONFIGURATION FILE PLEASE ONLY EDIT THE PARTS WHICH ARE INDICATED */ if(phpversion() < "5.1") { // date setting should be fine } else { // feel free to edit the value as desired date_default_timezone_set('UTC'); } /* email configuration */ $email_it_to = "[email protected]"; // email subject line $email_subject_pre = "Integrative Massage - Visitor Feedback"; // success page - the page the user gets when the form is successful $success_page = "/thanks.html"; /* your unique question and answer section */ // if you want to keep the default random maths questions // just leave the next few lines as they are. $rnumA = rand(0,49); $rnumB = rand(0,49); // if you want to create your own custom question and answer // edit the two lines below. $question = "$rnumA plus $rnumB?"; $answer = $rnumA+$rnumB; // pass the answer into the function below $answer_pass = mkEncStr($answer); /* your secret unique code used as part of our encryption */ // please edit the values within the double quotes, please use ascii characters only! // this is optional, you do not need to change this value $mkMine = "v25BeTa"; // DO NOT EDIT BE BELOW HERE $mkNow = date("YmdHi"); $enc = mkEncStr($mkNow)."::".mkEncStr($mkMine); // do not edit below this line function valEncStr($s,$m) { $sides = explode("::", $s); $sides[0] = mkDecStr($sides[0]); $sides[1] = mkDecStr($sides[1]); if(!count($sides) == 2) { $error = "String invalid!"; } // compare date/time $plTime = date("YmdHi",mktime(date("H"),date("i")+60)); $msTime = date("YmdHi",mktime(date("H"),date("i")-60)); if($sides[0] > $plTime || $sides[0] < $msTime) { $error = "Date not valid!"; } // compare custom word if(!$m == $sides[1]) { $error = "words do not match!"; } if(isset($error)) { return $error; } else { return true; } } function mkEncStr($s) { $a = mkArrA(); $b = mkArrB(); $s = base64_encode($s); $string_length = strlen($s); $new_string = ""; for($i=0;$i<$string_length;$i++){ $new_string .= $b[array_search($s[$i], $a)]; } return base64_encode($new_string); } function mkDecStr($s) { $a = mkArrA(); $b = mkArrB(); $s = base64_decode($s); $string_length = strlen($s); $new_string = ""; for($i=0;$i<$string_length;$i++){ $new_string .= $a[array_search($s[$i], $b)]; } return base64_decode($new_string); } here is form.php : <html> <HEAD> <title>Sara Illig - Integrative Massage</title> <style type="text/css"> <!-- A:hover { color : #996600; } .blackstyle { font-family : Arial, Helvetica; font-size : 12px; font-style : normal; line-height : normal; font-weight : normal; font-variant : normal; text-decoration : none; color : #000000; } --> </style> </HEAD> <!-- you can include your sites header above if you like --> <?php /* IMPORTANT: THIS FORM MUST BE SAVED AS A PHP FILE - USUALLY WITH A .php extension. Author: Stuart Cochrane URL: www.freecontactform.com Email: [email protected] Date: 21st Feb 2007 Version: 2.5 Beta 2 Updates: Includes generic JS and PHP form validators License: Free to use and edit, but all comments and must remain intact. Link to author website MUST remain - unless you have purchased the rights to remove it!! - see README file for details. THIS IS A DEMO OF HOW TO IMPLEMENT THE SPAM PREVENTION - SCRIPT INTO A FORM. */ // you MUST include the config.php file before your form include 'config.php'; // You can edit the form fields below if you like // but you must leave intact all parts which are indicated // with comments ?> <!-- if you want to use basic JavaScript validation, keep the JS file call below --> <script src="validation.js"></script> <script> // SPECIFY ALL REQUIRED FIELDS AND // SEE validation.js for other options required.add('fullname', 'NOT_EMPTY'); required.add('email', 'EMAIL'); required.add('comments', 'NOT_EMPTY'); required.add('answer_out', 'NUMERIC'); </script> <link rel="stylesheet" type="text/css" href="form_style.css" /> <form name="fcform2" method="POST" action="process_form.php" onsubmit="return validate.check()"> <center> <table border="0"> <tr> <td valign="middle" align="left"><b>Name</b></td> <td valign="middle"><input type="text" size="36" maxlength="50" name="fullname"></td> </tr><tr> <td valign="top" align="left"><b>Email</b></td> <td valign="top"><input type="text" size="36" maxlength="40" name="email"></td> </tr><tr> <td valign="top"><input type="checkbox" name="EFT" value="subscribe" checked></td> <td valign="top" align="left"><b>Sign up for EFT announcements!</b></td> </tr> </table> <font face="arial" size="2" color="000000"> <br> <b>Your message for Sara:</b> <BR> <textarea cols="60" rows="10" wordwrap="physical" name="Comments"></textarea><BR> <!-- the section below MUST remain for the magic to work --> <!-- although feel free to change the style / layout --> <div class="r"> <label for="quest" class="req"><?php echo $question; ?> <em>*</em></label> <span class="f"> <input type="text" name="answer_out" size="6" id="answer_out" onBlur="trim('answer_out')"> <!-- the link below MUST remain if you have not purchased a license --> <a href="http://www.freecontactform.com/" target="_blank" title="Spam Prevention Forms">Spam prevention</a> question. <!-- link above MUST remain if you have not purchased a license --> </span> </div> <!-- section above must remain --> <div class="sp"> </div> <p> <input type="submit" value=" Send " /> <input type="reset" value="Reset"> <br /> </p> </div> </center> <!-- the 2 hidden fields below must REMAIN for the magic to work --> <input type="hidden" name="answer_p" value="<?php echo $answer_pass; ?>"> <input type="hidden" name="enc" value="<?php echo $enc; ?>"> <!-- above 2 hidden fields MUST remain --> </form> <!-- you can include your sites footer below if you want --> <BODY background="/mainframebg.jpg" bgproperties="fixed"> <style type="text/CSS"> BODY { background: url("/mainframebg.jpg"); background-repeat: repeat; background-attachment: fixed; } </style> thanks in advance! Link to comment https://forums.phpfreaks.com/topic/45811-formmail-error-no-data-submitted/ Share on other sites More sharing options...
eideticmnemonic Posted April 5, 2007 Author Share Posted April 5, 2007 Thousands of members and no one can even venture a guess?? Amazing. Link to comment https://forums.phpfreaks.com/topic/45811-formmail-error-no-data-submitted/#findComment-222614 Share on other sites More sharing options...
per1os Posted April 5, 2007 Share Posted April 5, 2007 Or maybe it is because you are too ignorant to even read the rules. Hmm Amazing another person did not bother to follow the rules!! SIMPLY AMAZING! Link to comment https://forums.phpfreaks.com/topic/45811-formmail-error-no-data-submitted/#findComment-222618 Share on other sites More sharing options...
eideticmnemonic Posted April 6, 2007 Author Share Posted April 6, 2007 Excellent! Thank you for your response! You're absolutely right, I shouldn't have been in such a hurry as to skip over reading the rules. It's too bad, however, that I had to post something mildly inflammatory just to get a response in the first place. Worked like a charm though. I hope you have a beautiful day! Link to comment https://forums.phpfreaks.com/topic/45811-formmail-error-no-data-submitted/#findComment-222622 Share on other sites More sharing options...
kenrbnsn Posted April 6, 2007 Share Posted April 6, 2007 You are using a third party script. There is a support forum for this script. It would be much better for you if you posted your questions there. BTW, I took a look at the source for your web site. You really should learn how to write proper HTML. Ken Link to comment https://forums.phpfreaks.com/topic/45811-formmail-error-no-data-submitted/#findComment-222630 Share on other sites More sharing options...
eideticmnemonic Posted April 6, 2007 Author Share Posted April 6, 2007 Thank you Ken! That's actually helpful. I appreciate the constructive criticism, I definitely have a long way to go learning HTML and such, but for being a 14 year old girl, I think I'm doing ok! Link to comment https://forums.phpfreaks.com/topic/45811-formmail-error-no-data-submitted/#findComment-222634 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.