 |
|
 |
|
Next: Un Hide a Table
|
| Author |
Message |
External

Since: Oct 14, 2005 Posts: 3
|
(Msg. 1) Posted: Fri Oct 14, 2005 4:55 pm
Post subject: php include Archived from groups: alt>comp>lang>php (more info?)
|
|
|
I like to change a site from frames to a site that uses php pages with
include. But the site contains subfolders and in those subfolders are
images.
I want to make a page, say index.php that includes a page in the subfolder:
<?php include("pags/folder1/somepage.php")
But in that page there are images that are placed in a folder say:
pags/folder1/images/aimage.gif
And the file index.php is in the root (above pags) so when testing index
php, somepage.php is displayed, but not it's images, because they are nog in
a subfolder in the root url.
Is it possible to keep my folderstructure or is iit a lost cause?
SF
I appolgise for bad english, not my native language >> Stay informed about: php include |
|
| Back to top |
|
 |  |
External

Since: Dec 24, 2003 Posts: 145
|
(Msg. 2) Posted: Fri Oct 14, 2005 5:55 pm
Post subject: Re: php include [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
I noticed that Message-ID:
from SF contained the following:
>And the file index.php is in the root (above pags) so when testing index
>php, somepage.php is displayed, but not it's images, because they are nog in
>a subfolder in the root url.
>Is it possible to keep my folderstructure or is iit a lost cause?
It's possible, but you will have to change the links to your images to
absolute rather than relative links. Assuming pags is a folder in your
webroot then you would reference images like this
<img src='/pags/folder1/images/aimage.gif' alt='some alt text'> wherever
they are in the structure.
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011 >> Stay informed about: php include |
|
| Back to top |
|
 |  |
External

Since: Oct 14, 2005 Posts: 3
|
(Msg. 3) Posted: Fri Oct 14, 2005 6:55 pm
Post subject: Re: php include [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
"Geoff Berrow" schreef
> It's possible, but you will have to change the links to your images to
> absolute rather than relative links. Assuming pags is a folder in your
> webroot then you would reference images like this
> <img src='/pags/folder1/images/aimage.gif' alt='some alt text'> wherever
> they are in the structure.
>
Thanks Geoff,
It seems to be working (strangely enough this afternoon it didn't) but there
are quit a number of images to change, do you know a work around perhaps?
SF >> Stay informed about: php include |
|
| Back to top |
|
 |  |
External

Since: Mar 01, 2005 Posts: 47
|
(Msg. 4) Posted: Fri Oct 14, 2005 11:52 pm
Post subject: Re: php include [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
SF said the following on 14/10/2005 23:07:
> "Geoff Berrow" schreef
>
>>It's possible, but you will have to change the links to your images to
>>absolute rather than relative links. Assuming pags is a folder in your
>>webroot then you would reference images like this
>><img src='/pags/folder1/images/aimage.gif' alt='some alt text'> wherever
>>they are in the structure.
>>
>
> It seems to be working (strangely enough this afternoon it didn't) but there
> are quit a number of images to change, do you know a work around perhaps?
> SF
>
Possible workaround:
http://www.w3.org/TR/html4/struct/links.html#h-12.4
Other than that, you're going to have to replace all the image URLs. If
you have a decent code editor, you can do an "All files in folder"
search and replace, which will get the job done in about 1 second.
--
Oli >> Stay informed about: php include |
|
| Back to top |
|
 |  |
External

Since: Oct 14, 2005 Posts: 3
|
(Msg. 5) Posted: Sat Oct 15, 2005 12:00 pm
Post subject: Re: php include [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
|
| Back to top |
|
 |  |
| Related Topics: | include within include, using a relatve path - Hi, I have noticed something in PHP's include mechanism that surprised me. If you include a script that itself contains an include command using a relative path, that path is interpreted from the position of the 'outermost' script, not that of the scrip...
PHP include/require bug? - Why can't I include/require a file starting with the letter 't'? <?php require "C:\t.php"; ?> [11-Dec-2005 15:55:00] PHP Warning: main(C: .php) [<a href='function.main'>function.main</a>]: failed to open stream: Inv...
include statement - Has anyone ever experienced an issue with an include statement where the included file is processed, however, no further code is processed after the included content? I have used includes for quite a while, however, this is a new one for me. Any..
Cant get include to work... - Hi This may be easy to most of you, but as a newbiw; I'm struggling. I am bringing in an include into a php file, but cant run the commands within the include. As an example, Within my php page I write: {php}include("content/myinclude.php")...
How 2 include meta tags? - Hello, I have a small website and I use the include function for the top head section of each page. This is convenient but all the pages have the same meta tags as a result. I would like to have different meta tags for each page. What it the most.. |
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
 |
|
|