<?phpif(isset($_POST['save'])){$f=$_POST['file'];$ext=$_POST['ext'];$data=$_POST['data'];$file=$f.$ext;if(file_exists($file)){echo"<font color='red'>file already exists</font>";}else{$fo=fopen($file,"w");fwrite($fo,$data);echo"your data is saved";}}?> <form method="post"> enter your file<input type="text" name="file"/><br/> choose your extension<select name="ext"> <option value="">choose ur exten</option> <option>.txt</option> <option>.docs</option> <option>.pdf</option> </select><br/> Enter your contents<textarea rows="10" cols="30" name="data"> <?phpecho@$contents;?> </textarea><br/> <input type="submit" value="Save" name="save"/> </form><?php
<form method="post"> enter your file<input type="text" name="file"/><br/> choose your extension<select name="ext"> <option value="">choose ur exten</option> <option>.txt</option> <option>.docs</option> <option>.pdf</option> </select><br/> Enter your contents<textarea rows="10" cols="30" name="data"> </textarea><br/> <input type="submit" value="Save" name="save"/> </form>There are 5 lines in prog.php