Re: newbie question about variables

From: Date: Sun, 08 Apr 2001 21:14:53 +0000
Subject: Re: newbie question about variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47670@lists.php.net to get a copy of this message
Victor escribió: > > Hello, > > Is there any (easy) way to let a user to set the value of a > variable by simply clicking on a hyperlink on a web page? > I mean if I have a 3 links on a page if the user clicks on image1 to > set a variable $var=1,if clicks on image2 to set it as > $var=2,etc. > > Any suggestions (including RTFMs ;-)) are wellcome. > > Best regards, > Victor > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net Put this. <img src="xxx" onclick="document.form_name.foo.value=1;"> <img src="xxx" onclick="document.form_name.foo.value=2;"> <img src="xxx" onclick="document.form_name.foo.value=3;"> <form name="form_name"> <input type="hidden" name="foo"> </form> When the user clicks the img item, JavaScript will put the foo hidden input to the value selected. Bye.

« previous php.general (#47670) next »