local host (wamp) and path

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Markie
Forum Newbie
Posts: 2
Joined: Mon Oct 27, 2008 7:36 am

local host (wamp) and path

Post 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.
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Re: local host (wamp) and path

Post by novice4eva »

I think your link should be : http://localhost/website/register.php
Markie
Forum Newbie
Posts: 2
Joined: Mon Oct 27, 2008 7:36 am

Re: local host (wamp) and path

Post by Markie »

thank you. it works. :D
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Re: local host (wamp) and path

Post 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:
Post Reply