Hey Guys,
Basically what I am trying to do is to create a form where someone will enter their name or whatever, then save that name as a .txt file. Then it will input some data into that text file... well have a few issues.
Form:
proc.php:Code:<h1 align="center">Name Validator </h1> <form action="proc.php" method="post"> File Name: <input name="name" type="text" /> <br> Text: <input name="text" type="text" /> <input type="submit" value="GO!" /> </form>
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in W:\www\proc.php on line 4Code:<?php $myFile = "echo $_POST['name'].txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "echo $_POST['text']"; fwrite($fh, $stringData); fclose($fh); ?>
So confused, this is my first time doing this sort of thing.


Reply With Quote

)

