Mr_J Posted April 8, 2010 Share Posted April 8, 2010 Don't know how to do this... I have a contact form and it do the CAPTCHA verification for all those spammers. when I enter the code WRONG on purpose to test, my processor page (where the e-mail add is etc.) show only a single line: The Code Entered Was NOT Correct. Please go Back and Re-Type it Carefully. Instead of the user have to use the back in the browser's function, I want to add a Back Button. If I use normal html I get unexpected "<" on line 12 of processor.php To do:?? 1. simply close the php tag and start html, close the html tag and start php again??? or 2. include xxx.html with the back button and hyperlink??? Any help please Regards, MrJ Quote Link to comment https://forums.phpfreaks.com/topic/197970-can-i-include-html-in-processorphp/ Share on other sites More sharing options...
oni-kun Posted April 8, 2010 Share Posted April 8, 2010 You can do: print '<b>Code was not entered correctly! Go <a href="..">Go back</a>'; Make sure quotes are not conflicting (Such as only using double quotes , if they are within singles. That is the equivalent PHP code to "print" something out to the browser. I assume that is your problem. Quote Link to comment https://forums.phpfreaks.com/topic/197970-can-i-include-html-in-processorphp/#findComment-1038830 Share on other sites More sharing options...
Mr_J Posted April 8, 2010 Author Share Posted April 8, 2010 Thanx m8, I will quickly try, that is exactly what I need Quote Link to comment https://forums.phpfreaks.com/topic/197970-can-i-include-html-in-processorphp/#findComment-1038841 Share on other sites More sharing options...
Mr_J Posted April 8, 2010 Author Share Posted April 8, 2010 Thanx mate, I will quickly try, that is exactly what I need at which point do I add the print? <?php require_once('recaptchalib.php'); $privatekey = "xxxxxxxxxxxxxxxxxxxx"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { die ("The Code Entered Was NOT Correct. Please go Back and Re-Type it Carefully." . "(reCAPTCHA said: " . $resp->error . ")"); [i][b]This is where I had it first but nothing shows[/b][/i] } [i][b]and This is where I did it again also nothing[/b][/i] //$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); mail("[email protected]","New Message from SimplyHealth By MrJ @ www.mrjonline.co.za"," Name: " . $_POST['field_1'] . " Last Name: " . $_POST['field_2'] . " E-Mail: " . $_POST['field_3'] . " Telephone no: " . $_POST['field_4'] . " Web address: " . $POST['field_5'] . " Message: " . $_POST['field_6'] . " "); include("confirm.html"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/197970-can-i-include-html-in-processorphp/#findComment-1038848 Share on other sites More sharing options...
oni-kun Posted April 8, 2010 Share Posted April 8, 2010 die is an alias of exit and exits the script with a message. So: This: die ("The Code Entered Was NOT Correct. Please go Back and Re-Type it Carefully." . "(reCAPTCHA said: " . $resp->error . ")"); Can become: die ('Whatever in HTML you want here as the error message.'); Quote Link to comment https://forums.phpfreaks.com/topic/197970-can-i-include-html-in-processorphp/#findComment-1038850 Share on other sites More sharing options...
Mr_J Posted April 8, 2010 Author Share Posted April 8, 2010 Thank you very much, it is working perfectly though, I can only make the txt a link. When i use input type=button it gives a txt box with the value stated. Nevertheless, it is perfect Regards Quote Link to comment https://forums.phpfreaks.com/topic/197970-can-i-include-html-in-processorphp/#findComment-1038857 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.