Page 1 of 1

local host (wamp) and path

Posted: Mon Oct 27, 2008 7:48 am
by Markie
i'm trying to get the right path for my php scripts for wamp. i am using /index.php to addredirect a url. so its localhost>website> where my index page shows up and my nav bar. then when i click on register or any of the links i get the following path http://localhost/register.php and error message: The requested URL /register.php was not found on this server.
my files php including index.php are in website: C:\wamp\www\website and i need to redirect to index.php. this is accomplished by adding the following: /index.php
if some one can help i sure would appreciate it. if i'm not making myself clear please let me know .. i am a newbie to php and wamp.

Re: local host (wamp) and path

Posted: Mon Nov 10, 2008 5:10 am
by novice4eva
I think your link should be : http://localhost/website/register.php

Re: local host (wamp) and path

Posted: Mon Nov 10, 2008 6:55 am
by Markie
thank you. it works. :D

Re: local host (wamp) and path

Posted: Mon Nov 10, 2008 10:02 pm
by novice4eva
I was wondering how you put the "href" address, i mean did you do something like this:

Code: Select all

<a href="http://localhost/website/register.php">Register</a>
If that is the case then i strongly suggest that you use relative path, you might want to move your site OUT THERE IN THE VIRTUAL WORLD someday :D and that's when knowing these things come handy.
Just a short demo to give you an idea(i dunno if you already know this but then also)
Since your register.php page is in /website/ folder too as is your index.php, in your index.php page you can do just

Code: Select all

<a href="register.php">Register</a>
since both the pages are under same parent folder, that is that, no changes even if you were to rename your working folder from "website" to "mysite" etc etc. Just google about relative paths.

Cheers
:drunk: