Re: how to create files??
| From: | Aidal | Date: | Thu, 10 Oct 2002 08:25:26 +0000 |
| Subject: | Re: how to create files?? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119505@lists.php.net to get a copy of this message | ||
I'm using the following function to create the files. the function is part
of a class so "$this->somthing" refers to somthing in that class:
function create_file($file_name) {
if (!$this->fp = fopen($file_name, wb)) {
$this->error_msg .= $this->error_create . ' ' . $file_name;
return false;
} else {
$this->file = $file_name;
return $this->fp;
}
}
Also the script using this class is in the http-server-root and includes
this class. the include file isn't in the http-server-root, but that
shouldn't have any effect since it's not the include file that calls to
function.
The calling script: http-server-root
The include class: http-server-root\nef
Where I want to create files: http-server-root\nef\articles
Hope this gave you a better chance of helping me out :)
~ Aidal
"Timothy J Hitchens" <tim@hitcho.com.au> wrote in message
news:006b01c26f7a$28ffa110$0500a8c0@BAMBINO...
> If the script is in the same directory just try either "{file}" nothing
> in front or "./{file}"
>
> What function are you using to create files?
>
>
>
> Timothy Hitchens (HITCHO)
> tim@hitcho.com.au
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Aidal [mailto:aidal@nospam.dk]
> Sent: Wednesday, 9 October 2002 4:24 PM
> To: php-general@lists.php.net
> Subject: [PHP] how to create files??
>
>
> Hi NG.
>
> I'm having problems creating files at a certain location.
> If I attemt to create a file it gets created in the rootdir (htdocs)
> even though I add a path infront of the file name. I've tried severel
> ways of adding a path (with "/" and "\\") but nothing works.
>
> eksample: "/nef/articles/54.txt"
>
> File 54.txt gets created but not at the intented location, instead it
> gets created in htdocs.
>
> Can anyone help me by telling me how I'm suppose to do this? I'm running
> PHP on Win98 with Apache.
>
> ~ Aidal
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>