The header () does not seem to jump to seek help. it only receives data comparison and points to two php pages respectively. the php pages are all in one path. The form does not respond after it is submitted...
$ Username = $ _ POST ['username'];
$ Password = $ _ POST ['passwd'];
'If ($ password = "123 "){
Header ("Location: friendlist. php ");
} Else {
Header ("Location: login. php ");
}
?>
UserName:
PassWord:
Reply to discussion (solution)
You need to add an http: // localhost/../*. php in front of the *. php file in the header.
For example, $ host = $ _ SERVER ['http _ host'];
$ Uri = rtrim (dirname ($ _ SERVER ['php _ SELF ']),'/\ ');
For example, $ host = $ _ SERVER ['http _ host'];
$ Uri = rtrim (dirname ($ _ SERVER ['php _ SELF ']),'/\ ');
Can you give me more details? HTTP_HOST refers to http: // localhost/*. php?
Does PHP_SELF mean the php page that receives data?
$ Username = $ _ POST ['username'];
$ Password = $ _ POST ['passwd'];
$ Host = $ _ SERVER ['http _ host'];
$ Uri = rtrim (dirname ($ _ SERVER ['php _ SELF ']),'/\ ');
'If ($ password = "123 "){
Header ("Location: http: // $ host $ uri/friendlist. php ");
} Else {
Header ("Location: http: // $ host $ uri/login. php ");
}
Directly upload the code [hide] teste [/hide]
Is your current page logincontroller. php,
Because: action = "logincontroller. php"
$ Username = $ _ POST ['username'];
$ Password = $ _ POST ['passwd'];
$ Host = $ _ SERVER ['http _ host'];
$ Uri = rtrim (dirname ($ _ SERVER ['php _ SELF ']),'/\ ');
'If ($ password = "123 "){
Header ("Location: http: // $ host $ uri/friendlist. php ");
} Else {
Header ("Location: http: // $ host $ uri/login. php ");
}
Solved! Thank you. what is the meaning of the two codes caused by this problem?
You can check the php Manual.