2013-07-29 33 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元素。

相关问题