Web Hosting Talk







View Full Version : PHP for HTML Forms


HOI-Seaver
12-18-2003, 12:32 PM
Alright the basic problem comes in a while loop put in the else area of an if : else : endif; It does the print statement right before it and ignores the rest of the code.


if ($seenform != "y") :
print "$form";
else :
print "$manga";
while ( list($key, $val) = each($Char))
{
$filename = "$key.txt";
$fd = fopen ($filename, "a");
$contents = fread ($fd, filesize ($filename));
print "$contents";
fclose($fd);
}
print "$fave $gender";
endif;

Burhan
12-18-2003, 01:22 PM
Welcome to WHT :)

First thing, add error_reporting(E_ALL); as the first line of code.

Second, add echo "<pre>"; print_r($Char); echo "</pre>"; before you start your while loop.

Third, make sure that you use $_GET and $_POST superglobals because in the newer versions of PHP, register_globals is off by default.