Page 1 of 1

header redirect

Posted: Thu Apr 10, 2003 9:56 am
by Guy
I'm trying to redirect a page using header()

Code: Select all

<?php
header("Location: ../index.php?msg=User does not exists: $UserName")
?>
but I only get the first part of the returned string
when requeting msg (only User)

how can I get it all?
thanks
Guy

Posted: Thu Apr 10, 2003 10:15 am
by twigletmac
You can't have spaces in the text like that unless they are urlencoded, try something like:

Code: Select all

$msg = urlencode('User does not exists: '.$UserName);
header('Location: ../index.php?msg='.$msg);
Mac