How to use the PHP command "fwrite" with HTML form
Moderator: General Moderators
-
muffin mahon
- Forum Newbie
- Posts: 7
- Joined: Sun Aug 20, 2006 2:02 pm
How to use the PHP command "fwrite" with HTML form
Any help? Thanks!
-
muffin mahon
- Forum Newbie
- Posts: 7
- Joined: Sun Aug 20, 2006 2:02 pm
feyd | Please use
I got that code online.
I want to have a little questionaire with html form boxes, and then when the user hits submit I want it to send the data in the boxes to my log.txt file.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
$myFile = "log.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Bobby Bopper\n";
fwrite($fh, $stringData);
$stringData = "Tracy Tanner\n";
fwrite($fh, $stringData);
fclose($fh);I want to have a little questionaire with html form boxes, and then when the user hits submit I want it to send the data in the boxes to my log.txt file.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
http://php.net/language.variables.external may be of interest.
-
muffin mahon
- Forum Newbie
- Posts: 7
- Joined: Sun Aug 20, 2006 2:02 pm
I cant get this to work! Can you post some code I can copy/paste? I'm a noob =(. I wanna use this as my form boxes:
Code: Select all
<html>
<body>
<form action="anything.php" method="post">
Name: <input type="text" name="name"/>
Age: <input type="text" name="age"/>
<input type="submit"/>
</form>
</body>
</html>- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
Did you need a new thread for this?
I think that you should read:
http://us2.php.net/manual/en/tutorial.forms.php
I think that you should read:
http://us2.php.net/manual/en/tutorial.forms.php