Tôi đang làm việc trong một dự án và tôi được yêu cầu chạy chương trình của mình trên máy chủ web của người khác. Đó là một trang đăng nhập khá đơn giản mà tôi đang gặp vấn đề. Chương trình hoạt động chính xác nếu tôi chạy nó qua máy chủ địa phương của tôi thông qua WAMP. Vấn đề tôi gặp phải là phần trực tiếp không hoạt động chính xác, nó xác nhận người dùng và bắt đầu một phiên nhưng khi chuyển hướng không có gì xảy ra.
Tôi đang làm điều gì đó sai với cú pháp của mình mà tôi nghĩ rất khó xảy ra vì nó hoạt động chính xác thông qua máy chủ cục bộ của tôi. Hoặc thay vào đó, tôi nghĩ rằng máy chủ không có chức năng đó [không chắc chắn nếu có thể chọn và chọn mô -đun nào mà máy chủ của bạn hỗ trợ mặc dù tôi chắc chắn rằng nó khả thi].
Tôi không biết có vấn đề gì không nhưng họ đang sử dụng "cPanel", nơi tôi có thể truy cập các tệp và tất cả trong cùng một thư mục để nếu ai đó có thể cho tôi biết tôi đang đi đâu hoặc đề xuất một giải pháp thay thế để chuyển hướng thông qua "tiêu đề " Mọi sự trợ giúp sẽ rất được trân trọng. Tôi đã nhìn xung quanh nhưng có vẻ như "tiêu đề" là con ngựa làm việc tiêu chuẩn.
Đây là mã tôi có:
if[ [!empty[$_POST['username']]] && [!empty[$_POST['password']]] ]
{
// username and password sent from Form
$myusername = $_POST['username'];
$mypassword = $_POST['password'];
$sql="SELECT UserName FROM User WHERE UserName='$myusername' and Password='$mypassword'";
$result=mysql_query[$sql];
$row=mysql_fetch_array[$result];
//$active=$row['active'];
$count=mysql_num_rows[$result];
// If result matched $myusername and $mypassword, table row must be 1 row
if[$count==1]
{
echo "we made if to the if";
session_start[];
session_register["myusername"];
$_SESSION['login_user']=$myusername;
echo "right b4 the re-direct";
header["location: UI.php"];
exit;
}
else
echo "Your user name/password was not correct pleast TRY AGAIN!!!";
}
CẬP NHẬT: Đáp lại các câu nói về Echos, vấn đề có thể xảy ra khi tôi đang xử lý biểu mẫu của mình trong cùng một tệp và sử dụng Echo $ _Server ['PHP_elf']]
MJT tại Jpeto Dot Net ¶
13 năm trước
I strongly recommend, that you use
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
instead of
header["HTTP/1.1 404 Not Found"];
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
Most of the pages were displayed correct, but on some of them apache added weird content to it:
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
"0" at the bottom of the page [after the complete output of my php script]
It took me quite a while to find out about the wrong protocol in the HTTP-header.
I strongly recommend, that you use
0Marcel G ¶ ¶
12 năm trước
I strongly recommend, that you use
1
I strongly recommend, that you use
2
I strongly recommend, that you use
3
I strongly recommend, that you use
4
I strongly recommend, that you use
0Dylan tại Wedefy Dot Com ¶ ¶
15 năm trước
I strongly recommend, that you use
6
I strongly recommend, that you use
7
I strongly recommend, that you use
0Mandor tại Mandor Dot Net ¶
16 năm trước
I strongly recommend, that you use
9
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
0
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
1
I strongly recommend, that you use
0bobertjean tại yahoo dot fr ¶ ¶
13 năm trước
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
3
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
4
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
5
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
6
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
7
I strongly recommend, that you use
0Marcel G ¶ ¶
12 năm trước
header[$_SERVER["SERVER_PROTOCOL"]." 404 Not Found"];
9
Dylan tại Wedefy Dot Com ¶ ¶
15 năm trước
instead of
0
I strongly recommend, that you use
0 ¶
Mandor tại Mandor Dot Net
instead of
1
instead of
2
instead of
3
instead of
4
instead of
5
instead of
6
I strongly recommend, that you use
016 năm trước ¶
Mandor tại Mandor Dot Net
instead of
8
instead of
9
header["HTTP/1.1 404 Not Found"];
016 năm trước ¶
bobertjean tại yahoo dot fr ¶
header["HTTP/1.1 404 Not Found"];
1
header["HTTP/1.1 404 Not Found"];
2
header["HTTP/1.1 404 Not Found"];
3
header["HTTP/1.1 404 Not Found"];
4
header["HTTP/1.1 404 Not Found"];
5
header["HTTP/1.1 404 Not Found"];
6
header["HTTP/1.1 404 Not Found"];
7
I strongly recommend, that you use
0PHP tại Ober-Mail Dot de ¶ ¶
2 năm trước
header["HTTP/1.1 404 Not Found"];
9
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
0
I strongly recommend, that you use
0Tim tại SharpWebDevelopment Dot Com ¶ ¶
15 năm trước
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
2
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
3
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
4
I strongly recommend, that you use
0 ¶
Mandor tại Mandor Dot Net
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
5
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
6
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
7
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
816 năm trước ¶
Mandor tại Mandor Dot Net
I had big troubles with an Apache/2.0.59 [Unix] answering in HTTP/1.0 while I [accidentially] added a "HTTP/1.1 200 Ok" - Header.
9
Most of the pages were displayed correct, but on some of them apache added weird content to it:
0
Most of the pages were displayed correct, but on some of them apache added weird content to it:
1
Most of the pages were displayed correct, but on some of them apache added weird content to it:
2
Most of the pages were displayed correct, but on some of them apache added weird content to it:
3
I strongly recommend, that you use
016 năm trước ¶
13 năm trước
Most of the pages were displayed correct, but on some of them apache added weird content to it:
5
Most of the pages were displayed correct, but on some of them apache added weird content to it:
6
Most of the pages were displayed correct, but on some of them apache added weird content to it:
7
I strongly recommend, that you use
0bobertjean tại yahoo dot fr ¶ ¶
PHP tại Ober-Mail Dot de ¶
Most of the pages were displayed correct, but on some of them apache added weird content to it:
9
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
0
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
1
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
2
I strongly recommend, that you use
02 năm trước ¶
2 năm trước
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
4
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
5
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
6
I strongly recommend, that you use
0Tim tại SharpWebDevelopment Dot Com ¶ ¶
Mandor tại Mandor Dot Net
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
8
A 4-digits HexCode on top of the page [before any output of my php script], seems to be some kind of checksum, because it changes from page to page and browser to browser. [same code for same page and browser]
9
I strongly recommend, that you use
016 năm trước ¶
bobertjean tại yahoo dot fr ¶
"0" at the bottom of the page [after the complete output of my php script]
1
"0" at the bottom of the page [after the complete output of my php script]
2
I strongly recommend, that you use
0PHP tại Ober-Mail Dot de ¶ ¶
12 năm trước
"0" at the bottom of the page [after the complete output of my php script]
4
"0" at the bottom of the page [after the complete output of my php script]
5
I strongly recommend, that you use
0Dylan tại Wedefy Dot Com ¶ ¶
12 năm trước
"0" at the bottom of the page [after the complete output of my php script]
7
"0" at the bottom of the page [after the complete output of my php script]
8
"0" at the bottom of the page [after the complete output of my php script]
9
It took me quite a while to find out about the wrong protocol in the HTTP-header.
0
It took me quite a while to find out about the wrong protocol in the HTTP-header.
1
It took me quite a while to find out about the wrong protocol in the HTTP-header.
2
I strongly recommend, that you use
0Mandor tại Mandor Dot Net ¶
13 năm trước
It took me quite a while to find out about the wrong protocol in the HTTP-header.
4
It took me quite a while to find out about the wrong protocol in the HTTP-header.
5
It took me quite a while to find out about the wrong protocol in the HTTP-header.
6
It took me quite a while to find out about the wrong protocol in the HTTP-header.
7
It took me quite a while to find out about the wrong protocol in the HTTP-header.
8
It took me quite a while to find out about the wrong protocol in the HTTP-header.
9
I strongly recommend, that you use
00
I strongly recommend, that you use
01
I strongly recommend, that you use
0216 năm trước ¶
13 năm trước
I strongly recommend, that you use
03
I strongly recommend, that you use
04
I strongly recommend, that you use
05
I strongly recommend, that you use
06
I strongly recommend, that you use
07
I strongly recommend, that you use
08
I strongly recommend, that you use
09
I strongly recommend, that you use
10
I strongly recommend, that you use
11
I strongly recommend, that you use
12
I strongly recommend, that you use
0bobertjean tại yahoo dot fr ¶ ¶
12 năm trước
I strongly recommend, that you use
14
I strongly recommend, that you use
15
I strongly recommend, that you use
16
I strongly recommend, that you use
17
I strongly recommend, that you use
18
I strongly recommend, that you use
0Dylan tại Wedefy Dot Com ¶ ¶
15 năm trước
I strongly recommend, that you use
20
I strongly recommend, that you use
21
I strongly recommend, that you use
0
I strongly recommend, that you use
0 ¶
15 năm trước
I strongly recommend, that you use
23
I strongly recommend, that you use
24
I strongly recommend, that you use
0
I strongly recommend, that you use
0
¶
bobertjean tại yahoo dot fr ¶
I strongly recommend, that you use
26
I strongly recommend, that you use
27
I strongly recommend, that you use
0PHP tại Ober-Mail Dot de ¶ ¶
13 năm trước
I strongly recommend, that you use
29
I strongly recommend, that you use
30
I strongly recommend, that you use
02 năm trước ¶
Tim tại SharpWebDevelopment Dot Com ¶
I strongly recommend, that you use
32
I strongly recommend, that you use
33
I strongly recommend, that you use
34
I strongly recommend, that you use
04 năm trước ¶
15 năm trước
I strongly recommend, that you use
36
I strongly recommend, that you use
37
I strongly recommend, that you use
38
I strongly recommend, that you use
0
I strongly recommend, that you use
0 ¶
15 năm trước
I strongly recommend, that you use
40
I strongly recommend, that you use
41
I strongly recommend, that you use
42
I strongly recommend, that you use
43
I strongly recommend, that you use
0Cedric tại gn dot apc dot org ¶ ¶
11 năm trước
I strongly recommend, that you use
45