As tripy suggested, PHP varibles cannot start with a number. Also joining the entire fwrite string will make things much more effecient.
form page:
HTML Code:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form method="post" action="4.php">
Day: <input type="text" size="10" maxlength="50" name="var1"> <br />
Lvl: <input type="text" size="10" maxlength="50" name="var2">
<input type="submit" value="Add">
</form>
</body>
</html>
processing page (4.php)
PHP Code:
<?php $var1 = $_POST['var1']; $var2 = $_POST['var2']; $myFile = "1.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $var3 = "<br>"; $var4 = "**"; fwrite($fh, "$var3\n$var3\n$var1\n$var4\n$var2\n$var4"); fclose($fh); ?>
__________________
<mgraphic /> - I don't have a solution but I admire the problem.
|