hello again,
okay so what im tring to do is have text field that when you input text and submit , it creates new file with text value as the name.
as this shows this inputs the text into the file and randomly generates a # for the name of the file.
I have tried differant ways of doing this but just cant get it. any help would be nice.
<html>
<body>
<form name="form" method="post">
<input type="text" value="<?php echo htmlspecialchars($main_topic); ?>"
name="text_box" size="50"/>
<input type="submit" id="search-submit" value="NEW TOPIC" />
</form>
</body>
</html>
<?php
if(isset($_POST['text_box'])) { //only do file operations when appropriate
$a = $_POST['text_box'];
$n1 = rand (1, 99);
$myFile = "$n1.php";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $a);
fclose($fh);
}
?>