Scott Hurring wrote: > On 5/19/06, Richard Lynch <ceo@xxxxxxxxx> wrote: >> On Thu, May 18, 2006 9:23 pm, Mark Sargent wrote: >> > <title>Movie 1</title> >> > </head> >> > <body> >> > <?php >> > $favMovie=urlencode("Life Of Brian"); >> > echo "<a >> > href='http://localhost/moviesite.php?favMovie=$favMovie'>"; >> >> Errr. >> >> localhost is going to end up being THEIR localhost, which is, like, >> their own computer where the browser is, which is very very very >> unlikely to have your moviesite.php script on it, if you see what I >> mean... >> >> Unless YOU are running this on your own desktop or something. >> >> > I almost never use a server name for this reason. If you simply use an > absolute path, it'll point to whatever machine (local dev, live server, > etc...) it happens to be running on without you having to care. > > i.e. <a href='/moviesite.php?favMovie=$favMovie'> Which of course breaks if you decide to put the whole-shebang in a subdirectory (unless you specify the base in your html head). Personally, I prefer to deduce the path from the autoglobals (such as $SERVER['REQUEST_URI'] and friends), or to have it set in a central place (config.inc or whatever you use), so that i can move the whole app into a subdirectory if i want to. Gr, Koen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php