[thelist] php form variables

benjamin deboute deboute at nerdsoul.com
Wed May 31 04:40:27 2000


At 11:38 30/05/00 -0500, you wrote:
>alright... i could be way wrong on this (i'm fairly new to php), but 
>something like this might work:
>
>$button = document.form[0].imgbtn;
>
><?php
>      if ($button) {
>           do something
>      } else {
>           do something else
>      }
>?>


huh ?
how do you mess client-side javascript variable definition with a 
server-side php variable check ? : )

 ><input type="image" src="img1.gif" name="imgbtn">
 >can I reference it in a script like
 >
 ><?
  >  if ($imgbtn) {
  >     // do something
   > }
    >else {
     > // do something else
    >}
 >?>
if you don't give it a value, it won't work.
here it's value is set to '', so when it checks $imgbtn, it don't get anything.
if you want to get the click event on this image ::

<input type="image" src="img1.gif" name="imgbtn" 
onClick="document.form[x].elements['imgcheck']='true';">
<input type="hidden" value='false' name="imgcheck">

<?
   if($imgcheck) {
......
}
?>

that's how i would do it.

i may be wrong