Re: reading/editing php file with php script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux