2013-07-29 83 views
0

我創建了一個帶有調用PHP的表單的網頁,以從中獲取一些數據。但是當我通過PhoneGap製作這個網頁的應用並在黑莓手機上下載時。它不會收到任何數據。與此同時,當我通過黑莓瀏覽器看到我的網頁時,我可以查看我的網頁和所需的數據。可能的原因是什麼?BlackBerry PhoneGap對PHP的應用程序調用不起作用

這index.html的(爲的PhoneGap)

<!DOCTYPE html> 
<html> 
    <head> 
     <title>Mobile </title> 
    </head> 
    <body> 
     <form name="input" action="http://lowenstern.com.ar/test.php" method="post">`enter code here` 
      <input type="submit" value="Submit"> 
     </form> 
    </body> 
</html> 

config.xml中(爲的PhoneGap或WebWorks的從和例子在BlackBerry開發)

<?xml version="1.0" encoding="utf-8"?> 
<widget xmlns="http://www.w3.org/ns/widgets" 
     xmlns:rim="http://www.blackberry.com/ns/widgets" 
     version="2.0" 
     rim:header="RIM-Widget: rim/widget"> 

    <author href="http://www.example.com/" 
      rim:copyright="Copyright 1998-2012 My Corp">My Corp</author> 

    <rim:navigation mode="focus" /> 

    <name>Sample application</name> 

    <description> 
    A sample application to demonstrate some features. 
    </description> 

    <rim:orientation mode="auto"/> 

    <rim:loadingScreen backgroundImage="background.png" 
        foregroundImage="foreground.gif" 
        onLocalPageLoad="true"> 
    <rim:transitionEffect type="zoomIn" /> 
    </rim:loadingScreen> 

    <icon src="icons/example.png"/> 

    <rim:cache maxCacheSizeTotal="2048" maxCacheSizeItem ="256" /> 

    <content src="index.html" ></content> 

    <feature id="blackberry.ui.dialog"/> 

    <access uri="http://lowenstern.com.ar" subdomains="true"> 
    <feature id="blackberry.pim.memo"/> 
    <feature id="blackberry.app"/> 
    <feature id="blackberry.invoke.MemoArguments"/> 
    </access> 

    <rim:connection timeout="25000"> 
    <id>TCP_WIFI</id> 
    <id>MDS</id> 
    <id>BIS-B</id> 
    <id>TCP_CELLULAR</id> 
    <id>WAP2</id> 
    <id>WAP</id> 
    </rim:connection> 

    <license> 
    Example license 
    Copyright (c) 2012 My Corp. 
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
    WHETHER IN AN ACTION OF CONTRACT, INSULT OR OTHERWISE, ARISING 
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
    OTHER DEALINGS IN THE SOFTWARE. 
    </license> 

</widget> 

test.php的

<?php 
    echo 'Hello World'; 
?> 

有什麼建議嗎?

在此先感謝!

+0

您是否試圖直接從Phonegap應用程序運行PHP? – jeffheifetz

+0

所以,實際上我試圖從它接收「Hello World」 –

+0

如果我正確理解你,你試圖從index.html運行php是不可能的。沒有什麼可以解釋的PHP。 – jeffheifetz

回答

1

權限是這裏的主要嫌犯。檢查你的​​3210文件,並確保你有正確的access條目。請記住這樣一條:

<access subdomains="true" uri="*" />

應該禁用域限制,但不會使用Ajax調用工作。因此,請確保爲您的域添加access元素。

相關問題