In WordPress, you can edit the sites files from within the admin panel. I am building a site from scratch in php, and would like to build this into my site. Can anyone give me any suggestions on how to do this? How can you pull a list of files in a folder on my server, and then allow editing and savings of those files?
Thanks,
Chris
Editing PHP Files
Moderator: General Moderators
- aditya2071990
- Forum Contributor
- Posts: 106
- Joined: Thu May 22, 2008 11:30 am
- Location: Hyderabad, India
- Contact:
Re: Editing PHP Files
That cannot be done with php alone, you need JavaScript too.
Re: Editing PHP Files
You can fetch and display a list of files using glob() and iterate over the returned array. You can then open a selected file and load it into a textarea using one of the many file reading functions, such as file_get_contents(), and save it upon submission using one of the file saving functions such as file_put_contents().
Basically you would want to check out php file handling tutorials, such as this - http://www.codewalkers.com/c/a/Programm ... ext-files/.
Basically you would want to check out php file handling tutorials, such as this - http://www.codewalkers.com/c/a/Programm ... ext-files/.
- aditya2071990
- Forum Contributor
- Posts: 106
- Joined: Thu May 22, 2008 11:30 am
- Location: Hyderabad, India
- Contact:
Re: Editing PHP Files
Thanks for the link mate