Re: Re[2]: [PHP] display a hiddenfield

From: Date: Fri, 20 Feb 2004 13:49:13 +0000
Subject: Re: Re[2]: [PHP] display a hiddenfield
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-178349@lists.php.net to get a copy of this message
Ok problem solved thank you everybody ----- Original Message ----- From: "Richard Davey" <rich@launchcode.co.uk> To: "Dominique ANOKRE" <dominique.anokre@bull.ci> Cc: "Php List" <php-general@lists.php.net> Sent: Friday, February 20, 2004 11:35 AM Subject: Re[2]: [PHP] display a hiddenfield > Hello Dominique, > > Friday, February 20, 2004, 11:29:21 AM, you wrote: > > DA> I 've given a value se the code : > DA> $_POST["hiddenField"] = $image_avant; > DA> where $image_avant is a variable which contains a value !! > > No, you've overwritten whatever might have been in the $_POST array > with the image_avant value. > > Also even if this would work (which it doesn't) you are still > outputting the HTML to the browser BEFORE you do this anyway. > > Try like this (as has already been suggested): > > <? > print("<form method=\"post\" action=\"image.php\">\n"); > print("<input type=\"hidden\" name=\"hiddenField\" > value=\"$image_avant\">\n"); > print("<input type=\"submit\" name=\"avant\" > value=\"Avant\">\n"); > print("</form>\n"); > ?> > > -- > Best regards, > Richard Davey > http://www.phpcommunity.org/wiki/296.html > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#178349) next »