0

Cheers. I'm nearly there. As my html is all in php strings, I've had to edit the code you've just given me. Is this nearly right?

' . ((isset($_GET['error']) and ($_GET['error']=='recaptcha')) 
 { echo 'There was an error in your recaptcha'; } . '

It's showing up a syntax error on the second line.

1
' . ((isset($_GET['error']) and ($_GET['error']=='recaptcha')) ?
 'There was an error in your recaptcha' : '' . '
0

Cheers. Adding that code to the table just above the recaptcha sparks a syntax error on the last line of the following code:

<tr>
<td colspan="2" align = "center">' . ((isset($_GET['error']) and ($_GET['error']=='recaptcha')) ?
 'There was an error in your recaptcha' : '' . '
</td>
</tr>
<tr>
<td colspan="2" align="center"> 
'. $captcha .'
</td>
</tr>
<tr>
<th>&nbsp;</th>
<td>&nbsp;</td>
</tr>
</table>
<center><table width = "100%" style = "border: 0px; width: 395px"><tr><td align = "right">
<ul id="sbtbtn">
<li><a style = "margin-top: 5px; text-align: left; font: 8pt arial;" href="Javascript:verifyEnEnquiry(document.enquiries);" title="'.$sb->dt('Send Enquiry').'" class="darkblue">'.$sb->dt('Submit Enquiry').'</a></li>
</ul>
</td></tr></table>
<p style="text-align:right !important">
<!--<input name="submit"  style="border:none" type="image" src="./img/en/btn-sendenquiry.gif" title="'.$sb->dt("Send Enquiry").'">-->
</p>
</form>
</p>
<p><em>'.$sb->dt('*Mandatory fields').'<br />
</em></p>
';

Any idea why?

1

Try this. Next time, also paste your error message.

<td colspan="2" align = "center">' . (((isset($_GET['error']) and ($_GET['error']=='recaptcha')) ?
 'There was an error in your recaptcha' : '') . '
0

Still get the error:

Parse error: syntax error, unexpected ';' in /home/company/public_html/contact5.php on line 276

Edited by hindu times: n/a

0

Sorted it. It was a stray "(".

Thanks very very much for your help.

Out of curiosity, and this is the last thing from me, is there a way to add a red border to something instead of displaying the error message? So when they return to the page, the captcha has a red border around it?

And / or a way to display an entire table rather than just a message, when an error occurs?

Edited by hindu times: n/a

1

Well, if your captcha is contained within a div, instead of echo'ing text, you can echo an inline style for that div, enabling the red border. You control what you display.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.