Jump to content


Photo

Validate fields and then submit form for processing


  • Please log in to reply
2 replies to this topic

#1 Julian

Julian
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts

Posted 12 July 2006 - 09:33 PM

Hi

I have this code:

if($sti->checkPost() === true){
echo "<h1>Thank you, they mached!</h1>";//This is the line I want ot change
}elseif($sti->checkPost() === false){
echo "<h1>Wrong input! Try again!</h1>";
}

I'm checking for match the CAPTCHA value first.  If it's TRUE I want to process the POST values on another file (I keep the form separated from the process).

Does anybody know the code to process the form at another file when it's true?

If I put header (Location....  I get an error:  headers already send by...

Thanks guys, always good answers here.

#2 hussain

hussain
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 12 July 2006 - 11:04 PM


<?
if($sti->checkPost() === true){
  echo "<h1>Thank you, they mached!</h1>";//This is the line I want ot change
?>
<script>
document.form.submit();
</script>
<?
}elseif($sti->checkPost() === false){
  echo "<h1>Wrong input! Try again!</h1>";
}?>


#3 Julian

Julian
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts

Posted 12 July 2006 - 11:29 PM

Thanks for the help!

I have a submit button that triggers the form: <input type=submit>.

I think this makes your solution not working in my case....
Attaching the files to see if anybody can help me.

Thanks





[attachment deleted by admin]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users