Hi all
What I am trying to create is a page with a text field and a submit button, which when you click submit would enter the text into a freshly create .php file.
What I need is the page name to generate itself e.g.
user one goe’s to the page clicks submit and the information is entered into 1.php, then the next user goe’s to the page and clicks submit it would input the text into 2.php and so on.
here is the code so far:
<?php $kb = include("kbnum.php"); $file = fopen("$kb.php","w+");?>
information: <?php $text = $_POST['info']; fwrite($file, $text); fclose($file); $kbnum = (1 + $kb); $kb = $kbnum; $file2 = fopen("kbnum.php","w+"); fwrite($file2,$kbnum). ""; fclose($file2); ?>
So what I am looking to achieve with this is
The page calls the text in kbnum.php - which would be one to begin with
and stores it in $kb
The creates a using $kb.php which makes the file called 1.php
Then all the data is entered into this file and closed
Then page increments $kb by 1 and writes it to the file kbnum.php
then process would repeat over and over every time somebody hits submit
Unfortunally this isn’t working could someone help?