PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
raymedia
Forum Commoner
Posts: 27 Joined: Thu Oct 09, 2003 6:36 am
Location: Melbourne, Australia
Post
by raymedia » Wed Feb 11, 2004 1:00 am
i was developing my php site on windows - localhost and now i have moved it to unix server. but it seems it have problem with my relative path to files.
ie.
Code: Select all
<img src="images/corner/box_r1_c1.gif" alt="test"></img>
I have tried to look for an answer throughout the internet but no success.
i realise that i might solve this by using absolute path
ie.
Code: Select all
<img src="http://www.monkey.com/images/corner/box_r1_c1.gif" alt="test"></img>
but everytime i move the file i have to change it and i feel its not a very good practise. If anyone knows how to fix this, please help me. Thank you
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Wed Feb 11, 2004 3:24 am
on a side note for your reference <img> does NOT need a closing </img> tag.
what if you change your path to a root relative path like this
Code: Select all
<img src="/images/corner/box_r1_c1.gif" alt="test">
Mark
Wayne
Forum Contributor
Posts: 339 Joined: Wed Jun 05, 2002 10:59 am
Post
by Wayne » Wed Feb 11, 2004 3:24 am
is the path and file name all lower case on the server, as windows is not case sensitive whereas UNIX is, could be your problem.
raymedia
Forum Commoner
Posts: 27 Joined: Thu Oct 09, 2003 6:36 am
Location: Melbourne, Australia
Post
by raymedia » Wed Feb 11, 2004 3:49 am
I have check it, but every files names are lower case. Below are some bit of the code.
Code: Select all
head>
<title>TopStar Computer International :: <?=$title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/tci.css" type="text/css">
<SCRIPT language="javascript" src="script/javascript.js"></SCRIPT>
</head>
<body onLoad="MM_preloadImages('images/corner/box_r1_c1.gif','images/corner/box_r1_c2.gif','images/corner/box_r1_c3.gif','images/corner/box_r2_c1.gif','images/corner/box_r2_c3.gif','images/corner/box_r3_c1.gif','images/corner/box_r3_c2.gif','images/corner/box_r3_c3.gif','images/do.gif')">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3">
<table width="800" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="300">
<h2><b>
TopStar Computer International
</b></h2>
</td>
<td width="500" align="right"><img src="images/do.gif" width="450" height="71" align="top"></td>
</tr>
</table>
</td>
</tr>
<form action="logout.php" method="post">
<tr>
<td class="blueLine" align="left"><b><?=date("D, F j, Y") ?></b></td>
<td class="blueLine"></td>
<td class="blueLine" align="right">
<input class="logoutButton" type="submit" name"action" value="Logout">
</td>
</tr>
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Wed Feb 11, 2004 4:11 am
did you try my suggesion?
Mark
raymedia
Forum Commoner
Posts: 27 Joined: Thu Oct 09, 2003 6:36 am
Location: Melbourne, Australia
Post
by raymedia » Wed Feb 11, 2004 4:52 am
I did but no luck..its really frustrating.
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Wed Feb 11, 2004 5:14 am
well i cannot see how linux doesnt support relative paths, i have exactly the same sites on both my linux and windows box (2 seperate apache versions btw)
i copied and pasted my site from windows (so there is no changes) and every thing works fine, i would also like to point out that all my sites use document relative links so this cannot be the case
all i can think of is...........
1 - you do not have permissions to a certain folder on unix (quite likely, linux has a habit of <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>' you up in this way)
2 - your file paths are not 'cased' correctly