Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Display text from browser (form textfield) to a text files

Links for php scripts

Moderators: macek, egami, gesf

Display text from browser (form textfield) to a text files

Postby ill2000m » Sun Mar 30, 2003 6:52 am

i have wriiten a form and a php script and hope once i type anything in the text field text e.g if i type "reset" in the textfield and the word"reset" would produce in a text file ??

however i keep getting the error msg

Parse error: parse error, unexpected T_VARIABLE in /home/free-users/ill2000m/try.php on line 8

below shows the coding for my form (the file is called try.html)


<form action="try.php" method="POST">
type here: <input type="text" name="name" size="20" />

<input type="submit">

and my php script shows below (the file is called try.php)

<script language ="php">

$text = $_POST["totext"]

$topost = "<p>$text</p>"

$fp5 = fopen("textfile.txt", 'a');
fwrite($fp5, $topost);

yes yes
New php-forum User
New php-forum User
Posts: 3
Joined: Sat Mar 29, 2003 8:38 am

Postby Redcircle » Sun Mar 30, 2003 12:12 pm

every line must end with a ;
User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby MithikoS » Sun May 11, 2003 8:17 pm

second ...

you start with <?php and you ending with ?>


$hello = "HELLO2";
echo "HELLO";
echo $hello;

echo "<table><tr><td>HELLO</td></tr></table>";

You can use it... like that

echo "Hello";
HTML ....
echo "Hello again";

Now if you have to use html inside the php code you need to do that

echo "<table><tr><td width='100%'>Hello</td></tr><table>";

echo "OR..... ";

echo "<table><tr><td width=\"100%\">Hello</td></tr><table>";


New php-forum User
New php-forum User
Posts: 8
Joined: Sun May 11, 2003 7:56 pm
Location: London

Return to PHP Scripts

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.