|
Posted by Pedro Graca on 10/05/06 20:17
Garry Jones wrote:
> $antroj=0;
> $dtctxsz1 = $_POST["dtctxsz1"];
> if($dtctxsz1 == 0){
> print $dtctxsz1;
> $antroj = $antroj + 1;
> }
>
> It adds 1 to $antroj even when the value of $dtctxsz1 is not 0. I have
> spent 7 hours on this one problem. Its driving me nuts.
It works for me. Maybe some of the code you didn't post is the culprit.
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$antroj = 0;
$dtctxsz1 = '14'; // $_POST["dtctxsz1"];
if ($dtctxsz1 == 0) {
// print $dtctxsz1;
++$antroj;
}
echo 'after \'14\' $antroj is ', $antroj, ".\n<br>";
$dtctxsz1 = '0'; // $_POST["dtctxsz1"];
if ($dtctxsz1 == 0) {
// print $dtctxsz1;
++$antroj;
}
echo 'after \'0\' antroj is ', $antroj, ".\n<br>";
$dtctxsz1 = 'test'; // $_POST["dtctxsz1"];
if ($dtctxsz1 == 0) {
// print $dtctxsz1;
++$antroj;
}
echo 'after \'test\' $antroj is ', $antroj, ".\n<br>";
?>
[Back to original message]
|