Reply
PHP with web form?
Old 04-28-2005, 09:59 AM PHP with web form?
kiiyii's Avatar
Novice Talker

Posts: 6
I'm trying to get a web form to write its content to a file on the server, this is what i have so far:

my web page is:

<html>
<head></head>
<body>
<form action="results.php" method="post">
name: <input type="text" name="msg" size"30">
<input type="submit" value="Send">
</form>
</body>
</html>


results.php is:

<html>
<head></head>
<body>
<?php
$file = fopen("output.txt", "w");
$input = $_POST['msg'];
fwrite($file, $input);
fclose($file);
?>
</body>
</html>

and output.txt is just a blank file.

When I press the submit button on the webpage it seems to call the php script but it doesnt write to the file..... any help would be great.
kiiyii is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-28-2005, 10:00 AM
kiiyii's Avatar
Novice Talker

Posts: 6
woops, i just relaized this is in the wrong place.

Sorry
kiiyii is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP with web form?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11828 seconds with 12 queries