首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在OpenSocial小工具中提交PHP表单

在OpenSocial小工具中提交PHP表单
EN

Stack Overflow用户
提问于 2010-11-11 22:35:40
回答 2查看 401关注 0票数 2

我正在尝试为iGoogle实现一个OpenSocial小工具。我用PHP编写应用程序,然后使用XML gadget规范将其“包装”在一个opensocial容器中。

如果我在一个独立的页面中运行我的PHP,它工作得很好,在iGoogle容器中,当我按下表单上的按钮时,它会显示“找不到网页”。

我在这里做错了什么?如果我想使用PHP实现我的小工具,这是正确的方法吗?这可能吗?

XML小工具描述:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<Module>
    <ModulePrefs title="Register interest 29">
        <Require feature="opensocial-0.8"/>
        <Require feature="views" />
        <Preload href="http://opensocial-resources.googlecode.com/svn/samples/tutorial/tags/api-0.8/gifts.json" />
    </ModulePrefs>
    <Content type="html" href="http://myserver.com/OpenSocialSamples/test7.php">
    </Content>
</Module>

我有test7.php文件:

代码语言:javascript
复制
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Random DBpedia reader example</title>
    </head>

    <body>
        <form action="test7.php" method=post">
            Search: <input type=text name="searchString"><br>
            <input type=submit value="Get data" >
        </form>

        <br><br>
        <h3> Data Test: </h3>
        <?php
            if ($_GET['searchString']) {
                echo $_GET['searchString'];
            }
        ?>
    </body>
</html>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-11-15 05:06:22

在表单操作中使用test7.php的完整路径。

票数 0
EN

Stack Overflow用户

发布于 2011-02-09 01:53:50

我发现如果使用Content type="url“而不是"http”,它可以正常工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4155455

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档