lawrence wrote:
[color=blue]
> I'm probably missing something obvious, but I'm unable to write a file
> with this function. I've used my FTP software to set permissions to
> 777 on all the files in question. I've tried r, r+, w, and w+ as
> possible ways of opening the files.[/color]
Possibly need to use absolute paths so the server knows exactly where
the directory structure is. I always use a base path so files other than
in the directory I want are being overwritten.
<snip>
[color=blue]
> function fileUpdate() {
> $controllerForAll = & getController();
> $updateObject = & $controllerForAll->getObject("McTransactions", " in
> the function fileUpdate().");
> $resultsObject = & $controllerForAll->getObject("McResults", " in the
> function fileUpdate().");
>
> $formInputs = $GLOBALS["formInputs"];
>
> if (is_array($formInputs)) {
> extract($formInputs);
>
> $fileName = $fileName;[/color]
I'd suggest trying something more like:
$fileName= dirname(__FILE__).str_replace('../','',$fileName);
Where the directories you want to write into are located at the same
level as the file that contains this function declaration.
For instnace:
thisfile.php
writable_dir1/
writable_dir2/
etc...
[color=blue]
> $fileContent = $fileContent;
> $fileNameOld = $fileNameOld;
> $fileContentOld = $fileContentOld;
>
> $fileNameBackup = "backup_".$fileNameOld;[/color]
Same thing here. Use an absolute base path. This will _help_ with
preventing some bad holes from appearing, but the biggest thing to
remember: *DON'T* *TRUST* *USER* *INPUT* - even if it is from a posted form.
<snip>
--
Justin Koivisto -
spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League:
http://seo.koivi.com/