在OpenSocial gadget中提交PHP表单
我正在尝试为您实现一个小工具。 我正在用PHP编写应用程序,然后使用XML小工具规范将其“包装”到opensocial容器中 如果我在一个独立的页面上运行PHP,它可以正常工作,在iGoogle容器中,当我按下表单上的按钮时,它会显示“找不到网页” 我做错了什么?如果我想用PHP实现我的小工具,这是正确的方法吗?这可能吗 XML小工具说明:在OpenSocial gadget中提交PHP表单,php,opensocial,igoogle,Php,Opensocial,Igoogle,我正在尝试为您实现一个小工具。 我正在用PHP编写应用程序,然后使用XML小工具规范将其“包装”到opensocial容器中 如果我在一个独立的页面上运行PHP,它可以正常工作,在iGoogle容器中,当我按下表单上的按钮时,它会显示“找不到网页” 我做错了什么?如果我想用PHP实现我的小工具,这是正确的方法吗?这可能吗 XML小工具说明: <?xml version="1.0" encoding="UTF-8"?> <Module> <ModulePref
<?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
的完整路径。我发现如果使用Content type=“url”而不是“http”可以正常工作!如果我想用PHP实现我的小工具,这是正确的方法吗?这可能吗?我个人会编写一个小型javascript客户端,并通过gadgets.io.makeRequest与我的服务器对话。
<!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>