PDA

View Full Version : simple PHP send-to-text script


coolioman
10-27-2005, 02:09 AM
hey.

i want some data from a text area in my flash file to be sent to a .txt file...

i am using the following php script:<?php
$name = $_POST['said'];
$said = fopen("test.txt", "a+");
fwrite($said, "$name");
fclose($said);
header("Location: http://localhost/test.txt");
?>



and the following AS script:

on (release) {
loadVariablesNum("say.php", "POST");
}

iand i get this error message when tested on the server:


Notice: Undefined index: said in C:\Program Files\Abyss Web Server\htdocs\say.php on line 2

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Abyss Web Server\htdocs\say.php:2) in C:\Program Files\Abyss Web Server\htdocs\say.php on line 6


help is greatly appreciated

peptobismol
10-28-2005, 05:01 AM
<?php
$name = $_POST['said'];
$said = fopen("test.txt", "a+");
fwrite($said, $name);
fclose($said);
?>

Denexus
10-29-2005, 05:44 AM
I am trying to do the same thing, let us know if you get things working.:)
as well could you include the sources?

i get the errors

Denexus
10-29-2005, 06:34 PM
.

Flash Gordon
10-29-2005, 08:57 PM
<?php
$name = $_POST['said'];
$said = fopen("test.txt", "a+");
fwrite($said, $name);
fclose($said);
?>
That is the answer.

Denexus
10-29-2005, 09:38 PM
We both used that it still wasnt working for us.

coolioman
10-30-2005, 03:25 AM
i got it working almost perfectly....

ill talk to you via aim Denexus