php-windows Digest 29 Mar 2007 11:35:56 -0000 Issue 3175

Topics (messages 27600 through 27604):

Re: php include problem
        27600 by: bob plano
        27601 by: Hartleigh Burton
        27602 by: Niel Archer
        27603 by: Hartleigh Burton
        27604 by: Styve Couture

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-windows@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
just use absolute URL's when you have the script include the pictures

On 3/28/07, Pivi <[EMAIL PROTECTED]> wrote:
Hi!

I have this files in my root folder

index.php
header.php
footer.php
"images" folder

then i made one new folder "new" and i copied index.php, header.php and
footer.php in this new folder (also leaving this files in root folder, too).

Now header.php and footer.php files in folder "new" are searching for images
in folder /new/images

and it shoud be looking for images in root folder/images

How can i fix this, so that all files in root folder and same files in new
folder retrieve images from the same location?

Thanks!

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



--- End Message ---
--- Begin Message ---
When including try using ./new/images instead of /new/images

the . should tell it to start at root level.



On 29/03/2007, at 7:42 AM, Pivi wrote:

Hi!

I have this files in my root folder

index.php
header.php
footer.php
"images" folder

then i made one new folder "new" and i copied index.php, header.php and footer.php in this new folder (also leaving this files in root folder, too).

Now header.php and footer.php files in folder "new" are searching for images
in folder /new/images

and it shoud be looking for images in root folder/images

How can i fix this, so that all files in root folder and same files in new
folder retrieve images from the same location?

Thanks!

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






Regards,
Hartleigh Burton
Resident Geek

MRA Entertainment Pty Ltd
5 Dividend St | Mansfield | QLD 4122 | Australia
Phone: (07) 3457 5041
Fax: (07) 3349 8806
Mobile: 0421 646 978

www.mraentertainment.com



--- End Message ---
--- Begin Message ---
Hi

> When including try using ./new/images instead of /new/images
> 
> the . should tell it to start at root level.

No. the '.' tells it to start at current directory. '../' would tell it
to start at the parent directory (one level higher) so:

 "../images/"
 would work in this example.

bob's advice to use absolute paths would be safest though...

"www.your-domain.com/images/"



Niel

--- End Message ---
--- Begin Message ---
My bad ;)


On 29/03/2007, at 11:32 AM, Niel Archer wrote:

Hi

When including try using ./new/images instead of /new/images

the . should tell it to start at root level.

No. the '.' tells it to start at current directory. '../' would tell it
to start at the parent directory (one level higher) so:

 "../images/"
 would work in this example.

bob's advice to use absolute paths would be safest though...

"www.your-domain.com/images/"



Niel

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






Regards,
Hartleigh Burton
Resident Geek

MRA Entertainment Pty Ltd
5 Dividend St | Mansfield | QLD 4122 | Australia
Phone: (07) 3457 5041
Fax: (07) 3349 8806
Mobile: 0421 646 978

www.mraentertainment.com



--- End Message ---
--- Begin Message ---
I do this little trick in the main file I include in all my php files. So after 
that, I only use the constants regardless how deep I am in a folder.

//pour trouver comment/ou inclure les fichiers peut importe l'emplacement du 
fichier appelant
        if (!defined("SERVER_ROOT_PATH"))
        {    
                settype($str_pathUp, "string");
                $str_pathUp = str_repeat("../", 
substr_count($_SERVER['PHP_SELF'], "/")-2);    
                //on construit le chemin des fichiers       
                DEFINE("SERVER_ROOT_PATH", $str_pathUp);
                DEFINE("SERVER_FILE_PATH", SERVER_ROOT_PATH."fichier/");
                DEFINE("SERVER_INCLUDEFILE_PATH", 
SERVER_ROOT_PATH."includeFiles/");
                DEFINE("SERVER_IMAGE_PATH", SERVER_ROOT_PATH."image/");
                DEFINE("SERVER_CSS_PATH", SERVER_ROOT_PATH."css/");
                DEFINE("SERVER_TEMP_PATH", SERVER_ROOT_PATH."temp/");
                DEFINE("SERVER_LOG_PATH", SERVER_ROOT_PATH."log/");
                DEFINE("SERVER_CLASS_PATH", SERVER_ROOT_PATH."classe/");
                DEFINE("SERVER_ADODB_CLASS_PATH", SERVER_CLASS_PATH."adodb/");
                DEFINE("SERVER_MAIL_CLASS_PATH", SERVER_CLASS_PATH."mail/");
                DEFINE("SERVER_NEWMAIL_CLASS_PATH", 
SERVER_CLASS_PATH."phpmailer/");
                DEFINE("SERVER_ERROR_CLASS_PATH", 
SERVER_CLASS_PATH."errorHandler/");
                DEFINE("SERVER_SESSION_CLASS_PATH", 
SERVER_CLASS_PATH."session/");
                DEFINE("SERVER_SQL_CLASS_PATH", 
SERVER_CLASS_PATH."sqlWrapper/");
        }
        
        // Fonctions générales nécessaires à certaines classes.
        include_once(SERVER_INCLUDEFILE_PATH.'module_fonction_generale.php');





-----Message d'origine-----
De : Niel Archer [mailto:Niel Archer] De la part de Niel Archer
Envoyé : 28 mars 2007 21:32
À : php-windows@lists.php.net
Objet : Re: [PHP-WIN] php include problem

Hi

> When including try using ./new/images instead of /new/images
> 
> the . should tell it to start at root level.

No. the '.' tells it to start at current directory. '../' would tell it
to start at the parent directory (one level higher) so:

 "../images/"
 would work in this example.

bob's advice to use absolute paths would be safest though...

"www.your-domain.com/images/"



Niel

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

--- End Message ---

Reply via email to