我正在尝试为iGoogle实现一个OpenSocial小工具。我用PHP编写应用程序,然后使用XML gadget规范将其“包装”在一个opensocial容器中。
如果我在一个独立的页面中运行我的PHP,它工作得很好,在iGoogle容器中,当我按下表单上的按钮时,它会显示“找不到网页”。
我在这里做错了什么?如果我想使用PHP实现我的小工具,这是正确的方法吗?这可能吗?
XML小工具描述:
<?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文件:
<!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>发布于 2010-11-15 05:06:22
在表单操作中使用test7.php的完整路径。
发布于 2011-02-09 01:53:50
我发现如果使用Content type="url“而不是"http”,它可以正常工作。
https://stackoverflow.com/questions/4155455
复制相似问题