I tryed to create a way to copy a image to a new file with the username, like this:

$jogador= $_SESSION['username'];
@copy($sistema."/game234.png", "actual/".$jogador.".png");

And in this case:

username: RootShell

I end up with a picture called RootShell.png in my 'actual' directory.

The only problem is that locally it works, but when i upload to my JAG account, it doesnt. I guess it has to do with the chmod, but i cant chmod a file that does not exist, but i dont know how to chmod a directory.

Also, i use in my script (to speed up access) a :

header('Cache-Control: public');

And this works fine when the image filename keeps changing, but if I transform all the images from game243.png to username.png, then the script stops getting the 'updated/copied' actual directory file.

Meaning that once user sees page with picture Username.png it's always de same (read from cache) despite the fact that i change it in server (by way of copy).

The problem is that im affrad to remove the chace public, since the site will become more slow. Is there a way to specify the broswer to get a specific picture instead of using cache, so that:

1) I can use like 10 pictures from cache

2) tell browser to ALWAYS fetch the only one i want?

I know im confusing, but im also new to this new thing called PHP.

Thanks,
RootShell