Hi,

what I have tried is the following:

I have a site using php. The html pages include beside the css stuff two JavaScript files into every HTML-page. PHP reads in addition a normal textfile to get a configuration for the menue. The menue's configuration is a combination between this textfile and one of the JavaScript files. Both have to be updated online.

I know that i could use a database to hold the dynamic data but I want to try it by reading and overwriting this two files. Everything worked fine on my local network (NT/Apache/PHP4).

After uploading the site to my domain I got errors when the script tried to unlink / rename the files. I can't recall it but I guess it was 'fopen failes no permission...'.

The php code includes a function which tries different modes to delete the files if unlink doesn't work.

suppr("../js/openpage.js");

function suppr($file) {
$delete = @unlink($file);
if (@file_exists($file)) {
$filesys = eregi_replace("/","\\",$file);
$delete = @system("del $filesys");
if (@file_exists($file)) {
$delete = @chmod ($file, 0666); /* was 0755 */
$delete = @unlink($file);
$delete = @system("del $filesys");}}}

But basicly I think there is a problem with the rights on my domains server. So I've tried to set the attributes to 666 but it doesn't seem to work. I have no clue about the rights on Unix but thought it could be better to move all files to the cgi-bin folder.

When I had done that the HTML page seems to fail if it's going to include the JavaScript file. The link looks (in the PHP script)like this:

<script language='JavaScript' src='../cgi-bin/openpage.js' type='text/javascript'></script>

I'm not sure if it works with the 'cgi-bin' part in the link. I have also tried to move everything into the cgi-bin but now my php-scripts are no longer executed.

I have pulled all my hairs out. I there someone who can send me to the right direction? All I want is to have two files on a Unix server which could be unlinked renamed by the user.

Once again: I know I could do it by using my database but I'm just trying to learn about reading and writing something under PHP. I know that there would be a lot of security problems if I would use that, it's just an experiment.

It would be great if I could get some help. Please excuse my bad english, I'm german



regards

Ralf-J.