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

0 Members and 1 Guest are viewing this topic.

Offline ~V+Topic starter

  • Irregular
    • 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
  • 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.
Before posting, read the guidelines. When you do post a topic, post your code in code tags.
Turn on error_reporting() with E_ALL. Show us output & errors.
Before you ask me how to do something I suggest, try it.
"It doesn't work" isn't going to get any responses. Once you've changed your code, post the new code!
Before asking what a function does, check the manual: http://php.net

Offline Warptweet

  • Enthusiast
    • 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.

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.