passing variables and displaying their values in form fields
Posted: Mon Feb 02, 2004 1:21 pm
Hi, this is hopefully an easy one.
I can pass a value to a function:
i know this works becuase i can see the value of vid in the url
but how would i get the value to display in the fields of an HTML form by default?
i have tried:
but it is not working.
is it something to do with this bit?:
btw: that last quote actually has a question mark greaterthan sign on the end of it but is not showing up on the forum
any help would be great
thanks!
I can pass a value to a function:
Code: Select all
<FORM METHOD="post" ACTION="' . $_SERVER['PHP_SELF'] . '?editvenue=1; vid=' .$vid. '"><INPUT TYPE="submit" VALUE="Update"></FORM>but how would i get the value to display in the fields of an HTML form by default?
i have tried:
Code: Select all
<?php
elseif (isset($_GET['editvenue'])): // If the user wants to edit a venue
echo('
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
UPDATE VENUE<BR>
<p>Vid<br /> <BR>
<input type="text" name="vid" SIZE="4" VALUE="' . $vid . '"><br /><BR>
<TABLE><TR><TD><FORM><input type="submit" name="updatevenue" value="Submit" /></FORM></TD><TD><FORM METHOD="LINK" ACTION="updatevenue.php"><INPUT TYPE="submit" VALUE="Cancel"></FORM></TD></TR></TABLE>
</p>');
?>is it something to do with this bit?:
Code: Select all
<?=$_SERVER['PHP_SELF']?>any help would be great
thanks!