2017-05-26 137 views
0

我有我的手機上顯示的html頁面。用戶輸入一些信息並將它們發佈到我的localhost(WAMP)上的php頁面。在php頁面處理數據之後,它應該將用戶重定向到存儲在phonegap中的另一個頁面!如何指定此頁面的地址?從本地主機重定向到手機

在我的PHP頁面

我這樣做:

header("Location: blank.html"); 

在blank.html:

<html> 
<head> 
    <script type="text/javascript"> 
     window.location.href = 'file:///android_asset/destinationPage.php'; 
    </script> 
</head> 
<body> 
</body> 
</html> 

出於某種原因,瀏覽器停止在blank.html,只是顯示一個空白頁面沒有重定向。你能爲此提出任何解決方案嗎? 目標頁面存儲在C:\ PhoneGapProject \ WWW \ destinationPage.php

回答

0

使用

window.location.replace = 'http://yourpathtofile'; 

順便說爲什麼這個default.html中的Java腳本。從您的Php代碼本身重定向用戶。

+0

它不工作......我只需要知道PHP服務器如何指示phonegap應用程序打開特定頁面! – Kalkhouri

+0

是web服務器可以訪問的頁面「destinationPage.php」。嘗試從頁面回顯某些內容,並在瀏覽器中輸入url「http://yourpath/destinationPage.php」並查看回顯消息。 – CoderSam

相關問題