2013-08-26 2 views
1

내가 지불 업체에서 지불을 처리하는 스크립트가 다음에 "감사합니다"페이지를 표시 할 PHP 리디렉션을 사용하여 실행할 수 있습니다.헤더 위치 리디렉션 PHP 명령을 두 번

자료 :

<head> 
    <meta http-equiv="refresh" content="0; url=http://site.com/index.html"> 
</head> 
<script type="text/javascript"> 
    alert("Some alert"); 
</script> 

그러나 header("Location: ../success.html"); 명령이 두 번 실행 (사용자를 제공하기 위해 일으키는 success.html의

include_once 'Websend.php'; 
if ($file != "GREAT") { 
    header("Location: ../failed.html"); 
    exit(); 
} else { 
    $ws = new Websend("192.168.56.105"); 
    $ws->connect("passwd"); 
    $ws->doCommandAsConsole("give " . $token . " 2000"); 
    $ws->disconnect(); 
    header('Location: ../success.html'); 
    exit(); 
} 

출처 : (http://pastebin.com/raw.php?i=TmmysJiD Websend.php 소스를 포함 여기에있다) 일이 안 두 배. 내가 제거 header("Location: ../success.html"); 코드는 그것이 있어야로 작동합니다.

왜 이런 일이 발생합니까?

+0

이'succes.html'에 그 코드가 header('Location: ../success.html');header('Location: ../index.html');에 변경하려고 ?? 그렇다면 대답은 자명해야합니다. –

+0

succes.html의 내용을 게시하십시오 –

+0

@Dagon 아니요, 이것은 지불 공급자가 리디렉션하는 PHP 파일에 있습니다. – Timothy

답변

1

이 편집 success.html

<meta http-equiv="refresh" content="0; url=http://site.com/index.html"> 

상쾌

<meta http-equiv="refresh" content="0; url=http://site.com/index.html">을 제거하는 시도가? 또한

+0

예, 그게 전부입니까? –

+0

다음과 같습니다 : "사용자 지불 - 지불 제공자가 checkpayment.php로 리다이렉트 -"수표로 지불되었거나 실제로 지불되지 않았는지 확인 - 성공 또는 실패로 리디렉션 됨 HTML ->이 파일은 HTML 경고를 표시 한 후 홈페이지로 리디렉션 – Timothy

+0

이 최고'php' 코드가 – Vector