Question : login form in ajax, want to redirect the user to another page after sucessful login

I am making a login form using ajax. it ia almost complted. please see my function updatepage() here in this page i want to redirect the user to another page that is menu.php if the password entered is rigth otherwise alert message is shown
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
form.php
 




 

Login
User Name:
Password:
login.php Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\\wamp\\www\\ta\\2\\custom.mdb"); $query="select count(*) As RecCount from login where username='$username' and password='$password'"; $rs = $conn->Execute($query); while ( !$rs->EOF ) { $fv = $rs->Fields("RecCount"); $count = $fv->value; $rs->MoveNext(); } if ( $count > 0 ) { header("location: menu.php"); exit; } ?>
Open in New Window Select All

Answer : login form in ajax, want to redirect the user to another page after sucessful login

The problem is that the server does not see your login.php as a php page. So, instead of executing the code, it simply returns the entire page as-is.

There can be a few reasons for this:

short tags can be disabled. If this is true, you cannot start a php codeblock with
Otherwise, the server might not understand php at all. Does it run other scripts?
Random Solutions  
 
programming4us programming4us