tags:

views:

20

answers:

1

Hi, I have a code in VB that looks like this:

'Server.Transfer(txtUser.Text + "_page.aspx")

which is taking a forms authenticated user to their page. For example if John logs in, it will take him to john_page.aspx.

How will I be able to integrate this in a PHP login script? I'm trying something like:

header("location: $member . _page.php");

but I don't think I'm doing this correctly. I'm not sure if this is just the wrong syntax or if I'm going about it the wrong way.

Any help is appreciated!

A: 
$page = "_page.php";
header("Location: http://example.com/".$page);
exit();

You need to use the full URL if you want to redirect using header().

halfdan
So if I wanted to show a specific page for each user I could do something like this? $user = "member_id"; $page = "_page.php"; header("Location: http://example.com/".$user.$page); exit(); to show something like http://example.com/john_page.php
sliceofpie
Yes you could to that (remove that semicolon before $user).
halfdan