PDA

View Full Version : which slash "/" should i use?


habib
12-16-2002, 02:23 PM
Hi, I have just set-up my PHP server/parser thanks to Firepages (www.firepages.com.au) and its working like a dream.

The situation....

There are 10 index pages (one for each range) and these are in a directory under the public directory. Under each directory is a sub-directory which contains a description page for each product. On everypage there is a javascript menu (this is the same on everypage).

Before, I had a different menu for each page and the links were different on each menu:

i.e
index.htm - contact us link - <a href ="contact.htm"></a>
range1.htm - contact us link - <a href ="../contact.htm></a>
product1.htm - contact us link - <a href="../../contact.htm></a>

and so on.

By changing "../" to "/" the link would always start from the root - this meant I now only need one menu and with the help of PHP, I could echo out the menu on everypage - this made sense and was easy to administer.

The problem....

When I upload the site to the hosting server the page runs fine, all the scripts run and all the images are displayed. When I try to view the page locally, I get errors. When I look at the source code for images its looking at the following path: "c:\images\pr_red_165.jpg" instead of looking at the images directory from the site root.

Any ideas how I can resolve this problem?
P.s the web host company runs linux with apache (static module)

Regards
HR

ConfusedOfLife
12-17-2002, 08:19 PM
Maybe you should try http://localhost/ in your machine, I'm not sure! You can try the firepages forum too.

habib
12-20-2002, 09:36 AM
Apologies for late response.

I have tried http://localhost but when I view index.php I still can't see any images or run any scripts. I moved all my files from "C:\phpdev\www\public" to "c:\phpdev\www" and I can see the images and run most of the scripts.

From my understanding of the server set-up "www" is the root directory and because I am trying to view my images from "root/images" and not "root/public/images" I couldn't view the images.

Now the problem I am having is I can't use my cgi-bin scripts anymore!!!

When I try to use the following piece of code - it works fine on the web hosting server but not on the php server that has been setup locally. Here is the code:

<form method="get" action="../../cgi-bin/formmail/formmail.cgi">
<input type="hidden" name="recipient" value="email@email.com">
<input type="hidden" name="redirect" value="/info/thankyou.php">
<input type="hidden" name="missing_fields_redirect" value="/info/error.php">
<input type="hidden" name="mailsubj" value="Volunteer request from Website">
<input type="hidden" name="required" value="realname, address1, city, country, postcode, email">

// input fields for name, address, etc etc

<table border=0 align="left" width="507">
<input type=submit name="Submit" value="Submit" >
<input type="reset" name="Reset" value="Reset">
</table>
</form>

Any ideas why this doesn't work?