Hi all, i need a script for a form. The form has 3 texboxes ( for example ) When peeps click submit it creates a page from a skelenton page ( page template ) in a sub dir with the content of the 3 texboxes. Ive tried to keep it simple, dose anyone know a script that dose this ? Chears - Paul
didnt have a script but you can make do this by make script that: 1. Read POST information 2. Write POST contents to specific directory assume you use php, try searching google for "php read post" and "php write text file"
Seems hard to imagine; it's at once kind of specialised, and extremely simple to do (15 or 20 minutes). I think you're better off just hiring someone from the forum (not me; I don't like small projects).
Celaring it a little, SmallPot... said 15 or 20 minutes not actually days. I would suggest you hire him or send him PM regarding this issue.
i never said days . . . digitl point has a block for you posting paid requests with an account thats not 14 days old . .. so i would have to waut 14 days to make the post
The rules say you can't post to the BST section till after 14 days. I bet if you posted this again with the magic phrase - will pay, you will find someone to help you.
Probly, but by the fact that i am looking for a free script is because i dont realy want to spend money on getting this. However i was going to post to see how much someone would exspect to be paid to make this.
Odds are you will have to pay someone. Its pretty specific and not very general. If that made sense. Cost should be minor. 5-15, just depending on how much detail you want. It isn't difficult to do, just not something that would be made into a free script. Maybe one of the code snippet sites would have something? I might write something up to do this but odds are it would be days before I did since I have work to do. Actually, I take that back. Your request differs from what I was looking at writing ( I want folders created with files pre populated per user but no content added)
Sorry to be late, I suggested otherwise because I hadn't spare time last day. Here you go. This is simple example. Work on it little to make it more secure by creating sort of login etc. ASSUMED 3 FILES file1.html file2.html file3.html in templates folder containing word {REPLACE_DATA} to be relaced with input. Script will replace word {REPLACE_DATA} with input and write down file1, 2, and 3 html files in folder "output". Folder test must be chmod 777 s othat it has writing permissions. <? if(empty($_POST)) { ?> <form method="post"> Text 1 <input type="text" name="input1"><br> Text 2 <input type="text" name="input2"><br> Text 3 <input type="text" name="input3"><br> <input type="submit" value="Save"> </form> <? die(); } for($i=1; $i<=3; $i++) { $data = file_get_contents("templates/file$i.html"); if(get_magic_quotes_gpc()) $data = stripslashes($data); $data = str_replace("{REPLACE_DATA}",@$_POST["input$i"],$data); write_file("output/file$i.html",$data); } #will write down output1.html output2.html output3.html function write_file($filename,$data) { $f = fopen($filename,"w"); fwrite($f,$data); fclose($f); } ?> Code (markup): Sample of inut html files, e.g. file1.html <html> <head> <title>Some title</title> </head> <body> <b> {REPLACE_DATA} </b> </body> </html> HTML: Attached is the sample project. I hope it helps.
Hi voolor and thanks for the example code. I am havng a problom with it working. i chmod all files and folders to 777 and still dosent work. i have uploaded it to http:// www. beta.united-gamerz.com /index.php ( wihtout spaces ) what shal i do ? P.S i am using the attachment
i could be wrong, i have been wrong in the past, but should index.php start of with <?php and not <? or dose it not matter code you gave me and being used <? if(empty($_POST)) { ?> <form method="post"> Text 1 <input type="text" name="input1"><br> Text 2 <input type="text" name="input2"><br> Text 3 <input type="text" name="input3"><br> <input type="submit" value="Save"> </form> <? die(); } for($i=1; $i<=3; $i++) { $data = file_get_contents("templates/file$i.html"); if(get_magic_quotes_gpc()) $data = stripslashes($data); $data = str_replace("{REPLACE_DATA}",@$_POST["input$i"],$data); write_file("output/file$i.html",$data); } #will write down output1.html output2.html output3.html function write_file($filename,$data) { $f = fopen($filename,"w"); fwrite($f,$data); fclose($f); } ?> PHP:
<? is short tags and yes, if your webhost isn't configured it could result in the scripts not working. just switch it to <?php
yes it works for me as far as creating the files etc. <?php if(empty($_POST)) { ?> <form method="post"> Text 1 <input type="text" name="input1"><br> Text 2 <input type="text" name="input2"><br> Text 3 <input type="text" name="input3"><br> <input type="submit" value="Save"> </form> <?php die(); } for($i=1; $i<=3; $i++) { $data = file_get_contents("templates/file$i.html"); if(get_magic_quotes_gpc()) $data = stripslashes($data); $data = str_replace("{REPLACE_DATA}",@$_POST["input$i"],$data); write_file("output/file$i.html",$data); } #will write down output1.html output2.html output3.html function write_file($filename,$data) { $f = fopen($filename,"w"); fwrite($f,$data); fclose($f); } ?> PHP:
YES - it works now, because i had visited the page b4 ie8 made a catche of the file, so it looked like it wasent changing. Juts one last thing, dose any one know how to make the scrip make only one page, and the name and title of the page created, and so it dosent overite the same file ? thanx