php redirection


I have a problem I can’t understand

I have this line of code:

[php]header(“Location: templates/frontend/error.php?msg = ‘invalid login’”);[php]

the error.php is as follow

<?php $msg = $_GET["msg"]; echo $msg; ?>

But all I get is this message:

Notice: Undefined index: msg in D:\Web Data\divdev\templates\frontend\error.php on line 12

an someone help me?

Thank You

[php]header(“Location: templates/frontend/error.php?msg = ‘invalid login’”);[/php]

That is so wrong on so many levels. The following should work:

[php]header(“Location: templates/frontend/error.php?msg=invalid%20login”);[/php]

The reason you are getting an undefined index is because your original version had a space after msg and before the equal sign, which told webservers that the key for the item in $_GET was msg%20 and not msg.


It is working fine now

Sponsor our Newsletter | Privacy Policy | Terms of Service