Open a file?

Open a file?

am 26.05.2006 09:30:59 von Wim Van Geyt

Hi,

I want to send a choice to a textfile in php.
Now i don't know how to let the button communicate with the php script?
And do i have to write the script in the same page as the page where i have writed the radiobuttons?

Does anyone knows an answer ?

Thanks
Crazydj
-----------------------------------------------------
Mail.be, WebMail and Virtual Office
http://www.mail.be

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Open a file?

am 31.05.2006 22:25:41 von The Panister

Well....
You may try this:

First you can make a form and add the option to write to the file hidden in
the form... just like that:










-----------------------------------------
Then the Action File should be contain some thing like that:
// Here we get the information in about when the page visited.
$theText = $_POST["theText"];

$theText = stripslashes($theText);

// Here we open the file... Of course you will change the $filename with
the name of your file that you want the text to be written in it.
$data = fopen($filename, "a");

// And here we write the data.
fwrite($data,$theText);

// And here we close the file.
fclose($data);

?>

That's All.

Of course you can modify and enhance the code to meet your needs
I wish this help you.

The Panister!

Wim Van Geyt wrote in message
news:24971267.1148628659988.JavaMail.root@pumbaa...
> Hi,
>
> I want to send a choice to a textfile in php.
> Now i don't know how to let the button communicate with the php script?
> And do i have to write the script in the same page as the page where i
have writed the radiobuttons?
>
> Does anyone knows an answer ?
>
> Thanks
> Crazydj
> -----------------------------------------------------
> Mail.be, WebMail and Virtual Office
> http://www.mail.be

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php