Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 04-28-2005, 10:03 AM PHP and a webform
kiiyii's Avatar
Novice Talker

Posts: 6
Trades: 0
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.

i just posted this in the HTML help area, now it's here too...
admin wont be happy with me...
kiiyii is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-28-2005, 01:40 PM
pr0jekt's Avatar
Skilled Talker

Posts: 60
Location: Victor Harbor, South Australia
Trades: 0
try the php.net site, then search in the function reference each of your file functions:
fopen
fclose

etc...
they should have relevant comments at the bottom of each page so read them and see how u go
__________________

Please login or register to view this content. Registration is FREE


Im new here so play nice :)
pr0jekt is offline
Reply With Quote
View Public Profile Visit pr0jekt's homepage!
 
Reply     « Reply to PHP and a webform
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.51804 seconds with 12 queries