Can you write to .txt file fom html
I hope this is not a stupid question. I have been looking all morning on how to do this and I can't seem to find much on it. Is it even possible. Can someone point me to a tutorial or anything, I should be able to adapt it to what I am doing. Thanks!
You'll need a server side scripting language to do that. Does your host support php, asp or cgi?
I am not sure. I tried to look into php a little and put this into the head section
$fp = fopen($file, "a");//open file
but firefox gives an syntax error and points to the first line "<?php"
Do I have to add something to make php readable? I know only so much about HTML and very little about php.
Here's a tutorial on opening, reading and writing to text fiiles:
Remember that the page must have the .php extension and the directory that contains the text file that you want to write to must have "write" permissions.
All of this assumes that your host supports php.
Also, this thread would be better in the php forum.
Alright so my host doesn't support php. Maybe I am going about this the wrong way. I was trying to create like a little chat page. Real basic I type it and anyone on the page can read it and type back. Is there an easier way to do this? Thanks
If your host doesn't support server side languages then your only options are either to use a service provided by a third party or to move your hosting.
May seem basic to you, but there's a lot going on behind the scenes. Maybe try multicity.com. They have a free version.
Originally Posted by Deez
Also, if you had a good hosting account, many of them provide chat scripts pre-installed.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)