jason1987 Posted April 23, 2008 Share Posted April 23, 2008 I am absoutly baffled and confused by this one. I have a website which is all running as it should using xampp except on pages where they have a header line to goto another page e.g. header("Location: /jobview?jobid=$jobid"); this should then go to that page from the same folder that this page (the one with that code on) is in. But for some reason it jumps up a folder http://xx.xx.xx.x/jobview? and if i put the folder in the header header("Location: foldername/jobview?jobid=$jobid"); it then displays the folder twice in the address bar!! http://xx.xx.xx.x/foldername/foldername/jobview? what on earth is going on??? Quote Link to comment https://forums.phpfreaks.com/topic/102529-php-header-problem-using-xampp/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 23, 2008 Share Posted April 23, 2008 I'm not sure why you posted this in the web server section or why you bothered putting a poll, the problem has nothing to do with web servers or what a poll is for. The leading slash / in a relative URL refers to the domain root. So, /jobview means yourdomain/jobview. Adding the a folder to a relative URL means use that folder relative to the current folder, so you get the current folder plus what you listed. Just use - header("Location: jobview?jobid=$jobid"); Quote Link to comment https://forums.phpfreaks.com/topic/102529-php-header-problem-using-xampp/#findComment-524930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.