hello,
Im creating a registration page and i want to keep the user entered data after a generation of an error message.
form and the validations are in separate pages and validations belongs to a class.
html form

<form id="frmregister" name="frmregister" method="get" action="">
<tr>
<td><label>First Name </label></td>
<td colspan="2"><input name="txtfname" type="text" size="30" maxlength="20" value="<?php echo Handler:: $fname; ?>"/>*
</td></tr>
<--!more data--></tr><td width="113"><input class="button" type="submit" name="btnregister" value="Submit" /></td></tr>
</form></table>

All methods i used are static
this is the class that handles the submition

class Handler{
	public static function register()	{
		
		if(isset($_GET['btnregister']))
			{
                        $fname=trim($_GET['txtfname']);
                        //some more codes
                        }
}

as you see im trying to access $fname but it does not work. i think there is a better way to do this.. can anyone please give me an idea?

Ok... I found a way to do it.. using sessions :)

Yeah.. thanx... by the way.. now that i have solved it.. my "reset" button is inactive.. since the sessions will remain till being destroyed. i can use a "submit" type button and call session_destroy() to achieve it, but. i want to do something different, keeping the “reset” type button. can i do something with javascript? or is there any other way???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.