Click to See Complete Forum and Search --> : [RESOLVED] question about PHP 5


matt1776
07-12-2006, 04:10 PM
im trying to make these values 'sticky' so that when the user submits, if he/she is missing something, they dont have to fill out feilds already typed in, this is what im used to using:

<table border="0" cellspacing="5">
<form method="post" action="<?php $_SERVER[PHP_SELF]?>">
<input type="hidden" name="action" value="activate">
<tr><td>First Name</td><td><input type="text" name="fname" value="<?=$fname?>"></td></tr>
<tr><td>Last Name</td><td><input type="text" name="lname" value="<?=$lname?>"></td></tr>

So that when the values post to the server, the page refreshes and the values for those feilds have the values in them already. However the server im using has php 5 installed. SO i tried this instead:

<table border="0" cellspacing="5">
<form method="post" action="<?php $_SERVER[PHP_SELF]?>">
<input type="hidden" name="action" value="activate">
<tr><td>First Name</td><td><input type="text" name="fname" value="<?php $_POST['fname']?>"></td></tr>
<tr><td>Last Name</td><td><input type="text" name="lname" value="<?php $_POST['lname']?>"></td></tr>

And still no luck. What am I doing wrong? I thought I had this down.

bokeh
07-12-2006, 04:30 PM
<?php echo @$_POST['lname'] ?>

matt1776
07-12-2006, 04:41 PM
why cant i do this:

<?php=$_POST['fname']?>

matt1776
07-12-2006, 05:02 PM
n/m the last post. i see what needs to be done now