Re: [PHP] reading/editing php file with php script
- From: robert@xxxxxxxxxxxxx (Robert Cummings)
- Date: Sat, 06 Jan 2007 18:37:05 -0500
On Sat, 2007-01-06 at 15:12 -0800, jekillen wrote:
Hello;
I have been writing a php script which is supposed to open and edit a
php file on the same server,
in the same directory. But I have not been able to get regex as in
function ereg() to work to match
a line of code to alter. I also have not been able to get strpos() to
work in this code. I am not
complaining, i am just curious if this is a security feature of php,
that it can't be used to open
and edit existing script files on a web server. Or am I doing something
wrong? I have successfully
used php to write a php script file from scratch and then include it.
It works good for keeping track
of things on the server.
PHP can open and write to any file for which it has permissions. Have
you checked your error log? Have you checked the return value of
fopen()? Have you checked that the file permissions allow the webserver
read/write access to the target file? Can you read the file but not
write? Does file_exists() return true or false for the file?
Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
.
- References:
- reading/editing php file with php script
- From: jekillen
- reading/editing php file with php script
- Prev by Date: RE: [PHP] Re: Search script problem
- Next by Date: Re: [PHP] php, curl and aol addressbook import problem
- Previous by thread: reading/editing php file with php script
- Next by thread: Search script problem
- Index(es):
Relevant Pages
|