anyone has experience with PHP programming

PatrickOttawa

新手上路
注册
2004-08-25
消息
53
荣誉分数
0
声望点数
0
[FONT='Calibri','sans-serif']Hi Everyone,[/FONT]

[FONT='Calibri','sans-serif']I am kind of new to PHP programming, I am doing some coding, here I have some questions.[/FONT]

[FONT='Calibri','sans-serif']I have a login page which is written by html and java , after filling in the user name and the password, I will send the request to server, there is actually a php page to connect with MySQL server and check if the username and password are correct. My question here is how I get back to login page if not the correct user, and how to go to the main page if the user is authorized.[/FONT]

[FONT='Calibri','sans-serif']Thanks![/FONT]
 
You can use header( ) method to transfer to another page.

For example, if login success, call

header("Location: http://yourserver/mainpage.php");

otherwise, call
header("Location: http://yourserver/loginpage.php");
 
1.你还是用ajax吧,这样提交form的时候可以让phpfile返回一些你定义的数值,然后通过java code进行判断,然后显示错误内容,如果使用Header如果前面有显示内容,会有warning信息。
 
后退
顶部