Jump to content

PHP Header help


vidar42

Recommended Posts

I searched for my issue and I'm sure it's been covered but I can't seem to find it.

 

I'm doing a login form and want to redirect the page to the username after it is validated.  

 

Here is the code : 

 

 

 

header('Location: profile.php?id=' .$_SESSION["username"]);
 

 

 

it's not working and it's appending this to the URL : 

 

 

 

profile.php/?id=testuser
 

 

 

I tried escaping the ? and it did the same thing...

 

 

header('Location: profile.php\?id=' .$_SESSION["username"]);
 

 

Help please?

Link to comment
Share on other sites


$aid = $_POST['artcid'];
$uid = $_POST['userid'];

header('location:../artikeldetail.php?msg=86&articleid='.$aid'&userid='.$uid);

 

it returns Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

 

the correct way to do this?

 

 

header('location:../artikeldetail.php?msg=86&articleid='.$aid

 

returns http://localhost/articles/artikeldetail.php?msg=86&articleid=24

 

i want to show user id too

Edited by ardhix
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.