Jump to content

Recommended Posts

So I finally got my CAPTCHA to implement just nicely. What I'm wondering is...is there a way to produce an error message on the same page without wiping the fields that the user just filled in?

 

At the moment I have

 

if ($_SESSION['security_code'] != $_POST['security_code'] && !empty($_SESSION['security_code'])){
header("Location: /pacesetter/index.php?id=quotes&subid=downunder&error=1");
exit;

 

if($_GET['error'] == 1){
echo "<span class='wrongcode'>You entered an incorrect security Code...</span><br />";

 

If you want to see what I mean: www.pacesettertravel.com/pacesetter/index.php?id=quotes&subid=downunder

Link to comment
https://forums.phpfreaks.com/topic/50853-form-error-message-keep-fields-filled-in/
Share on other sites

Hmm...dunno where the hell I'm going wrong, but I can't seem to get either of them to work. Odd...

 

<?php
$oldvalu = '';
if(isset($_POST['name'])) {
	$oldvalu = $_POST['name'];
    	}
echo"<input name=\"name\" type=\"text\" value=\"$oldvalu\" class=\"formstyles\" />";
?>

 

<input type='text' name='email' class="formstyles" value='{$_POST['email']}' />

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.