Hello, I figured out how to create a file with php. However I need to edit the new file that I created. The file is a php file, i just want to put some html and some php in it. Does anyone know how to edit this file with using php? Thank You, Jason
Just open it with notepad and add whatevery you intend to add. And then save. Its that easy. Hope I am preety clear.
<?php $fp=fopen("test.php","r"); $content=fread($fp,8192); ?> <textarea rows="30" cols="100" value="<?php echo $content; ?>"><?php echo $content; ?></textarea> PHP: The above code will open the file "test.php", read it into the $content-variable, and post that variable as the value of a text-field. You can then add to that so when you submit the form with the text-field, you rewrite the file in question, using the value from the textfield.
A php file can be opened with any standard text file program. For example, even microsoft notepad will open and save to PHP files. Providing it has no actual PHP code/programming involved in the file, you could actually rename it as a HTML file and edit it the same way. As for visually editing the HTML elements of a PHP file, dreamweaver is probably one of the better tools to use however there are many programs which will do this. You will need to search for "WYSIWYG" editors.