Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8632
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
| Newsgroups | comp.lang.php |
| Subject | Re: Include file in localhost |
| Date | Mon, 11 Mar 2013 09:56:26 +0100 |
| Lines | 35 |
| Message-ID | <aq5khqF62rdU1@mid.uni-berlin.de> (permalink) |
| References | <083528a4-0753-40f7-9f74-74056bf0c019@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de Z3wOFkVT3665JtR3+VYVlgGnmzGPdZQO63TtIw8jLwMcAfI3B/FslnV5pzig0PCrM= |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 |
| In-Reply-To | <083528a4-0753-40f7-9f74-74056bf0c019@googlegroups.com> |
| Xref | csiph.com comp.lang.php:8632 |
Show key headers only | View raw
Am 10.03.2013 03:16, schrieb huynhtoan.it@gmail.com:
> My project(Mysite) have some folder and file as
> .folderA
> + a.php
> + b.php
> .folderB
> + c.php
> .folderC
> .folder D
> + d.php
> index.php
> ................
> when I want to include file a.php in index.php, I have code
> include("folderA/a.php")->I know
>
> when I want to include file a.php in d.php and link to index.php, my code must like
> include(../../folderA/a.php)
> <a href="../../index.php">ex</a>-> It's ok.
>
> But when I have include file d.php in c.php, I have an error:
> a href link to another directory in my warm because a href is ../../index.php
> I try to a href("/Mysite/index.php") But my address in google Chrome is http://localhost/Mysite/folderC/folderD/localhost/Mysite/index.php -> it's wrong
> Can You give me a method to correct it??
>
After the technical details are answered, you should ask yourself if your folder
structure makes sense.
It looks like a mess. You would normally avoid to include from here and there across
the directory tree.
And then see the differences between include(), require(), require_once().
/Str.
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Include file in localhost huynhtoan.it@gmail.com - 2013-03-09 18:16 -0800 Re: Include file in localhost Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-09 23:05 -0500 Re: Include file in localhost Denis McMahon <denismfmcmahon@gmail.com> - 2013-03-10 04:09 +0000 Re: Include file in localhost The Natural Philosopher <tnp@invalid.invalid> - 2013-03-10 11:40 +0000 Re: Include file in localhost "J.O. Aho" <user@example.net> - 2013-03-10 15:15 +0100 Re: Include file in localhost "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-11 09:56 +0100 Re: Include file in localhost LômCôm Toàn <huynhtoan.it@gmail.com> - 2013-04-14 18:41 -0700
csiph-web