p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: checkboxes value not appearing


Message #1 by "Rob Bryant" <rkbryant@m...> on Thu, 25 Jan 2001 16:56:03 -0800
In the example on pages 85-87, checkbox.html, I have set the values in the

html

file for haggis, locusts, and snails. E.g.,



<input type="checkbox" name="choice1" value="haggis">



But when I click on submit, I am still getting "on" rather than the value

name. Also, I have to put the echo() statements within isset() conditionals

or I get an error, like so:



if (isset($choice1)) echo "$choice1<br>";



I am using PHP 4.0.4 and IIS 5.0 on Win2K Pro. Any idea why I see "on" and

not the value? Am I missing something?



Thanks,



-Rob



Message #2 by "Rob Bryant" <rkbryant@m...> on Fri, 26 Jan 2001 09:34:22 -0800
> -----Original Message-----

> From: Rob Bryant [mailto:rkbryant@m...]

> Sent: Thursday, January 25, 2001 4:56 PM

> To: beginning php

> Subject: [beginning_php] checkboxes value not appearing

>

>

> In the example on pages 85-87, checkbox.html, I have set the values in the

> html

> file for haggis, locusts, and snails. E.g.,

>

> <input type="checkbox" name="choice1" value="haggis">

>

> But when I click on submit, I am still getting "on" rather than the value

> name.



I figured this one out: the html page was cached, and the edits I made

weren't showing up until I reloaded it a few times. I should have known

better.



> Also, I have to put the echo() statements within isset()

> conditionals

> or I get an error, like so:

>

> if (isset($choice1)) echo "$choice1<br>";

>



This is a lot different from the examples in the book where unset variables

don't report errors. Any ideas?



-Rob




  Return to Index