Jump to content

Foosicle

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Foosicle's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a form with the following validation in the header. <?php if(!isset($fromemail) || empty($fromemail) || !isset($fname) || empty($fname) || !isset($lname) || empty($lname) || !isset($message)){ echo '<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.*********.com/include/createusererror.php">'; }else{ header('Location: http://www.*********.com/profile.php'); } ?> It then redirects back to the form, however all form data is lost. I am lost on how to save their data across this redirect. Help, masters of the force. It would be really cool to highlight the err on their screen. MOD EDIT: Fixed cratered code tags . . .
  2. $recaptcha_challenge_field = $_POST["recaptcha_challenge_field"]; $recaptcha_response_field = $_POST["recaptcha_response_field"]; echo $recaptcha_challenge_field; echo $recaptcha_response_field; so according to this.. they are not getting posted. strange because I have no way of seeing the code in the form other than : <?php require_once('include/recaptchalib.php'); $publickey = "************************-******* "; // you got this from the signup page echo recaptcha_get_html($publickey); ?> So if that is not displaying anything.. should i worry? and how?
  3. In an effort to validate safe data I have attempted to implement stripslashes, trim, and htmlentities... How does that code look? $fromemail = stripslashes($fromemail); $fname = stripslashes($fname); $lname= stripslashes($lname); $message = stripslashes($message); $fromemail = trim(htmlentities($fromemail)); $fname = trim(htmlentities($fname)); $lname= trim(htmlentities($lname)); $message = trim(htmlentities($message));
  4. Found this error to be: TYPO!! $fromemail = $_POST['fromemail']; if(!isset($frommail) ||
  5. //VALIDATE form data exists if(!isset($frommail) || !isset($fname) || !isset($lname) || !isset($message)){ echo 'We are sorry, but there appears to be a problem with the form you submitted.'; }else{ echo 'success'; } This gives me err. 'We are sorry, but there appears to be a problem with the form you submitted.'
  6. here comes the error my verify file looks like: <?php $errors = array(); //READ the user recaptcha require_once('recaptchalib.php'); $privatekey = "******************************"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); //READ the posted form data $fromemail = $_POST['fromemail']; $fname = $_POST['fname']; $lname = $_POST['lname']; $message = $_POST['message']; //VALIDATE form data exists if(!isset($frommail) || !isset($fname) || !isset($lname) || !isset($message)){ echo 'We are sorry, but there appears to be a problem with the form you submitted.'; }else{ echo 'success'; } $fromemail = stripslashes($fromemail); $fname = stripslashes($fname); $lname= stripslashes($lname); $message = stripslashes($message); $fromemail = trim(htmlentities($fromemail)); $fname = trim(htmlentities($fname)); $lname= trim(htmlentities($lname)); $message = trim(htmlentities($message)); //VALIDATE !errors if (!empty($errors)){ redirect_to("http://www.*******.com/index.php"); } //CREATE the email form data $to = "customerservice@*******.com"; $subject = $fname . " " . $lname; $headers = "From: " . $fromemail; if (!$resp) { // What happens when the CAPTCHA was entered incorrectly echo ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); }else { // Your code here to handle a successful verification echo "SUCCESS!"; } mail($to, $subject, $message, $headers); ?>
  7. <table> <tbody bgcolor="#EFEFF5"> <form name="helpform" method="post" action=""> <div id="recaptcha"> <?php require_once('include/recaptchalib.php'); $publickey = "**************************** "; // you got this from the signup page echo recaptcha_get_html($publickey); ?> </div> <tr id="contactform"> <td>Your Email: </td> <td> <input name="FROM" type="text" size="40" maxlength="30" value="<?php echo stripslashes(trim(htmlentities($FROM))) ?>" onFocus="this.value==this.defaultValue?this.value='':null"> </td> </tr> <tr id="contactform"> <td>First Name: </td> <td> <input name="fname" type="text" size="40" maxlength="20" value="<?php echo stripslashes(trim(htmlentities($fname)))?>" onFocus="this.value==this.defaultValue?this.value='':null"> </td> </tr> <tr id="contactform"> <td>Last Name: </td> <td> <input name="lname" type="text" size="40" maxlength="20" value="<?php echo stripslashes(trim(htmlentities($lname)))?>" onFocus="this.value==this.defaultValue?this.value='':null"> </td> </tr> <tr id="contactform"> <td>Message: </td> <td> <textarea name="message" rows="5" cols="31" maxlength="200" value="<?php echo stripslashes(trim(htmlentities($message)))?>" wrap="physical"></textarea> </td> </tr> </tr> <tr> <td> <input type="submit" value="Submit" action="mail()"> </td> </tr> </form>
  8. So far I have visible: 1. the form 2. the recaptcha working on mail() func
  9. Today's pain: http://code.google.com/apis/recaptcha/docs/php.html Getting the above to function on my site.. All aid appreciated.
×
×
  • 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.