Toon posts:

PHP probleem

Pagina: 1
Acties:
  • 40 views sinds 30-01-2008

Verwijderd

Topicstarter
ok.. ik zit dus php te leren,...

wil zeg maar een form iemand laten invullen, en dan versturen naar een pagina waar ik $user.txt als bestand aanmaak, en daar bepaalde gegevens uit een form in bewaar....

zeg maar zoiets als dit....

<html>
<head>
<title>---Setup2.php---</title>
</head>
<body>
<form method=post action=account2.php>
<table border=0><tr><td>Voornaam:</td><td>
<input type="text" name="user"></td></tr>
<tr><td>Achternaam</td><td>
<input type="text"name="last"></td></tr>
<tr><td><input type=submit value="Verstuur">
</td></tr>
</table>
</form>
</body>
</html>


<html>
<head>
<title>account2.php</title>
</head>
<body>
<?php
touch ("$user.txt");
if ( $fp = ("$usefopenr.txt", 'w'))
{
$first = "Uw voornaam is $user";
$second = "Uw achternaam is $last";
fwrite ($fp, $first);
fwrite ($fp, $second);
fclose ($fp);
}
if ( isset ($user))
print "Uw voornaam is $fuser";
if ( isset ($last))
print "Uw achternaam is $last";
?>
</body>
</html>


dar gaf ie iedere keer error dus heel simpel gemaakt...

setup.php

<html>
<head>
<title>Account setup</title>
</head>
<body>
<form action="account.php" method=GET">
<input type="text" name="user">
<input type="submit" value="verstuur">
</form>
</body>
</html>


account.php
<html>
<body>
<?php
print "hallo $user";
?>
</body>
</html>


met
echo "hallo ".$user;

werkt ie ook niet, als ik in de url http://localhost/account.php?user=iwein invul, krijg ik ook deze error:


Notice: Undefined variable: user in C:\phpsite\account.php on line 4
hallo

oftewel hij maakt van <input type="text" name="user"> NIET automatisch $user,

toen bij iemand anders getest (via inet), bij hem werkte het script wel, dus waar kan de fout liggen?

gebruik win XP pro NL, en IIS, had vorige week de nieuwste php voor windows gedownload van de php site....

graag hulp :S

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 09-01 11:25

D2k

Doet iets met Cloud (MS/IBM)


Dit topic is gesloten.