Jump to content

PHP Header problem using XAMPP


jason1987

What is going on with my header here??  

  1. 1. What is going on with my header here??

    • add in the folder name to php code (dont work though - tried)
      0
    • I dont know
      0


Recommended Posts

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???

 

 

Link to comment
Share on other sites

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");

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.