Form losing data for invalid captcha

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
dt22
Forum Commoner
Posts: 32
Joined: Sat Oct 10, 2009 2:53 am

Form losing data for invalid captcha

Post by dt22 »

can anyone show any example to store the session value to a session variable?
Last edited by dt22 on Thu Jan 27, 2011 9:27 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Form losing data for invalid captcha

Post by John Cartwright »

<input id="security_code" name="security_code" type="text" />

to

Code: Select all

<input id="security_code" name="security_code" type="text" value="<?php echo isset($_POST['security_code']) ? htmlentities($_POST['security_code'], ENT_QUOTES) : ''; ?>" />
You basically need to repopulate the value attribute.
Post Reply