Jump to content

Can I Include .html in Processor.php?


Mr_J

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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("me@domain.com","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");

?>

Link to comment
Share on other sites

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.');

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.