Author Topic: I know this exists, but I forgot the code, help!  (Read 442 times)

0 Members and 1 Guest are viewing this topic.

Offline ~V+Topic starter

  • Irregular
  • Posts: 1
    • View Profile
I know this exists, but I forgot the code, help!
« on: January 17, 2007, 11:39:59 PM »
I used to have a code for my website that would retreive information from a text bar on my website.

I dont know if you understand that but its hard to explain.


basically I had a text bar, like the one you put your subject in like when you make a new topic, when a button was hit it would put the information that was typed into a bar into a .txt file on my server, so I could keep track of whats going on.

I was trying to re-do my website, and the guy who was hosting me deleted everything off my server, I really need this code back, can anyone help me?

Offline jesirose

  • Fanatic
  • Posts: 3,819
  • Gender: Female
  • PHP Goddess
    • View Profile
    • Reed's Training Blog
Re: I know this exists, but I forgot the code, help!
« Reply #1 on: January 17, 2007, 11:45:57 PM »
the button is a submit button on a form, then you use $_POST to get the value, and then use file writing, check out fwrite, fopen etc.
Every time you post "It didn't work" without more explanation, God kills a kitten.
When you post code without code tags, He just teases a puppy. But it's still sad.
What does that php function do? | What does that term mean? | I don't see any errors! | Awesome API Interface
PHP Goddess with Attitude since 2004

Offline Warptweet

  • Enthusiast
  • Posts: 306
    • View Profile
Re: I know this exists, but I forgot the code, help!
« Reply #2 on: January 18, 2007, 12:32:30 AM »
When you submit text to a form, and it uses something like textbar.php to process it, use this code...

$somevariablename = $_POST['formnamehere']

Then you use the fopen and fwrite functions to write $somevariablename to the text file.