|
|
#1 (permalink) |
|
Registered User
Join Date: Jan 2003
Location: UK
Posts: 928
|
(php) links in echoed pages..?
ok say my directory structure is like this..
/public_html/ index.html /public_html/css/ index.php files.php /public_html/css/data/ page1.html page2.html page1.html has a link to files.php (../files.php) if i put the following code in /public_html/css/index.php will the links point to /public_html/css/files.php or will it point to /public_html/files.php (which doesnt exist) ? Code:
<?php
$data = file_get_contents('page1.html');
echo "$data";
?>
Thanks Colin
|
|
|
|
|
|
#2 (permalink) |
|
Registered User
Join Date: Oct 2003
Location: United Kingdom
Posts: 186
|
It will point to /public_html/css/files.php.
../ Goes back one directory. and ./ is the the current directory. What i would to save complication in the future is define a variable, say called $dir_root which would containt the full root to your base directory. EG $dir_root = 'http://www.yourwebsitename.com'; You can put this in a file called config.php and call it from every page or you just define that variable on every page. So you would link like this to the files.php in the css folder. <a href="<? echo "$dir_root"; ?>/css/files.php"> Hope you understand, because when i read it back to myself, didnt make sense :0
__________________
RIG 1 AMD Athlon XP3000+ PC Chips M848ALU Crucial DDR 512MB PC2700 160GB Seagate HD ATI Radeon 9600 Atlantis 128MB |
|
|
|
|
|
#6 (permalink) |
|
Registered User
Join Date: Jan 2003
Location: UK
Posts: 928
|
Well i have a script that out puts a message based on whether the script failed or was successfull or not...
i could just echo the words "success" and "failed" but that just one word on a blank white page, doesnt really look v good, so i keep my page layout in a text file and echo that instead
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|