php quikcy

Associate
Joined
26 Jan 2006
Posts
1,502
I got a checkbox with name="box" value="5"

What post returns in $_POST["box"] if the checkbox wasnt checked?

Is it null or something? I tried to display but no output.

Thanks
 
It'll return a null. You need to also change you " " to ' '

Use something like :

if (isset ($_POST['box'])){

do this


}
 
cool, thanks!

So .. I must use ' instead of "?

I know that 'box' interprets it as a the string box while "$box" (example) will get the value of $box. Is this correct?

And another thing that got me puzzled is that when I do:

echo "<table border="1">";

I get errors because of the quaotation marks :(


Thanks for helping!

ps: They could decide on one type of quotes in PHP! :p
 
Basically, when echo'ing html and using " ", they close the echo from the php. To stop this, either put a \ before they " " in the html, like this:

echo "<table border=\"1\">";

or you could use ' ' around the thing you want to echo like this:

echo '<table border="1">';

' ' can't close a " " nor the other way around. Hope this helps.

JB
 
Back
Top Bottom