Post & Get(Very Urgent)

0 views
Skip to first unread message

mini

unread,
Apr 22, 2008, 8:07:54 AM4/22/08
to OpenSocial - OpenSocial Application Development
Hi Guys,

It's very urgent.

I would like to build an application in Orkut with below features.

I would like to provide an Textbox with a submit button. When an User
writes his/her message on that
box and submits that goes into the database. Then I want to fetch some
data according to that message in the database & that fetched data
will be displayed in a div in my application.
I would be using PHP with MySql.How can I use gadgets.io.makeRequest
for this purpose.How the methodtype is set.Plz provide some
description.

Please help & also provide some code snippets & example for this.

Stephane

unread,
Apr 22, 2008, 9:43:03 AM4/22/08
to OpenSocial - OpenSocial Application Development
It would sure be real nice to have the example code solving your
posting and reading issue.

But I'm a newbie too and cannot help much.

The only thing that I can give you is this url
http://code.google.com/apis/opensocial/docs/0.7/devguide.html#POST

Stephane

unread,
Apr 22, 2008, 9:45:34 AM4/22/08
to OpenSocial - OpenSocial Application Development
I'm also trying to display a form in a social app but I have a problem

The page is fetched fine and displayed, but the form input fields are
not displayed.

The gadget source code:

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Thalasoft Admin Login">
<Require feature="opensocial-0.7"/>
</ModulePrefs>
<Content type="html">
<![CDATA[
<div id="content_div"></div>
<script type="text/javascript">

function makeNormalRequest() {
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
var url = "http://www.thalasoft.com/engine/system/admin/
login.php";
gadgets.io.makeRequest(url, response, params);
};

function response(obj) {
var str = obj.text;
var html = str.substr(0, 10000);
alert(html);
document.getElementById('content_div').innerHTML = html;
};

makeNormalRequest();
</script>
]]>
</Content>
</Module>

Aakash Bapna

unread,
Apr 22, 2008, 11:23:48 AM4/22/08
to opensoc...@googlegroups.com
Hi Stephane,
The makeRequest() function doesn't generate the code for input boxes, buttons. You have to add the code for html for them your selves;
 
here is the code that should give you input box, button.
 
<?xml version="1.0" encoding="UTF-8" ?>
 <Module>
 <ModulePrefs title="Thalasoft Admin Login">
 <Require feature="opensocial-0.7"/>
</ModulePrefs>
 <Content type="html">
 <![CDATA[

 <script type="text/javascript">
 
function makeNormalRequest() {
 var params = {};
 params[gadgets.io.RequestParameters.CONTENT_TYPE] =
 gadgets.io.ContentType.TEXT;
 var url = "http://www.thalasoft.com/engine/system/admin/
 login.php";
 gadgets.io.makeRequest(url, response, params);
 };
 
function response(obj) {
 var str = obj.text;
 var html = str.substr(0, 10000);
 alert(html);
 document.getElementById('content_div').innerHTML = html;
 };
 
</script>
 
<input type="text" name="test" id="textbox" size="10"/>
<button onClick="javascript:makeNormalRequest();">Start test</button>
<div id="content_div">response text comes here</div>
 ]]>
 </Content>
 </Module>

 
 
Thanks
 
~Aakash Bapna
http://aakash-bapna.blogspot.com





> Date: Tue, 22 Apr 2008 06:45:34 -0700
> Subject: [OpenSocial] Re: Post & Get(Very Urgent)
> From: mittip...@gmail.com
> To: opensoc...@googlegroups.com

Meenu Gupta

unread,
Apr 23, 2008, 12:01:23 AM4/23/08
to opensoc...@googlegroups.com
THanks to all.I'll try all above examples.

Meenu Gupta

unread,
Apr 24, 2008, 12:53:03 AM4/24/08
to opensoc...@googlegroups.com
Is it possible to fetch data posted by my application at some url/file (e.g. - http://www.thalasoft.com/engine/system/admin/login.php)  by $_POST?????????

mini

unread,
Apr 24, 2008, 8:08:15 AM4/24/08
to OpenSocial - OpenSocial Application Development

Hey Guys,
I m getting -
Missing or malformed url parameter
Error 400

when I send POST request at some url.

wht is this????wht is the solution for this?????????????

Plz Help me..............

Thanks in advance

On Apr 24, 9:53 am, "Meenu Gupta" <rose.star.me...@gmail.com> wrote:
> Is it possible to fetch data posted by my application at some url/file (e.g.
> - *http://www.thalasoft.com/engine/system/admin/login.php) by
> $_POST?????????*
>
> On Wed, Apr 23, 2008 at 9:31 AM, Meenu Gupta <rose.star.me...@gmail.com>
> wrote:
>
> > THanks to all.I'll try all above examples.
>
> > On Tue, Apr 22, 2008 at 8:53 PM, Aakash Bapna <aak...@live.com> wrote:
>
> > > Hi Stephane,
> > > The makeRequest() function doesn't generate the code for input boxes,
> > > buttons. You have to add the code for html for them your selves;
>
> > > here is the code that should give you input box, button.
>
> > > *<?xml version="1.0" encoding="UTF-8" ?>
> > > <Module>
> > > <ModulePrefs title="Thalasoft Admin Login">
> > > <Require feature="opensocial-0.7"/>
> > > </ModulePrefs>
> > > <Content type="html">
> > > <![CDATA[
>
> > > <script type="text/javascript">
>
> > > function makeNormalRequest() {
> > > var params = {};
> > > params[gadgets.io.RequestParameters.CONTENT_TYPE] =
> > > gadgets.io.ContentType.TEXT;
> > > var url = "http://www.thalasoft.com/engine/system/admin/
> > > login.php";
> > > gadgets.io.makeRequest(url, response, params);
> > > };
>
> > > function response(obj) {
> > > var str = obj.text;
> > > var html = str.substr(0, 10000);
> > > alert(html);
> > > document.getElementById('content_div').innerHTML = html;
> > > };
>
> > > </script>*
> > > **
> > > *<input type="text" name="test" id="textbox" size="10"/>*
> > > *<button onClick="javascript:makeNormalRequest();">Start test</button>*
> > > *<div id="content_div">response text comes here</div>
> > > ]]>
> > > </Content>
> > > </Module>
> > > *
>
> > > Thanks
>
> > > ~Aakash Bapna
> > >http://aakash-bapna.blogspot.com
>
> > > ------------------------------
>
> > > > Date: Tue, 22 Apr 2008 06:45:34 -0700
> > > > Subject: [OpenSocial] Re: Post & Get(Very Urgent)
> > > > From: mittiprove...@gmail.com

Aakash Bapna

unread,
Apr 24, 2008, 8:17:22 AM4/24/08
to opensoc...@googlegroups.com
Hey,

That happens when you are not URL encoding the string passed in http request.
please use the encodeURI() function in JS on the POST variable you are passing..
more on it here-> http://www.w3schools.com/jsref/jsref_encodeURI.asp
Thanks
 
~@@k@sh
http://aakash-bapna.blogspot.com


> Date: Thu, 24 Apr 2008 05:08:15 -0700

> Subject: [OpenSocial] Re: Post & Get(Very Urgent)

mini

unread,
Apr 25, 2008, 12:43:35 AM4/25/08
to OpenSocial - OpenSocial Application Development
Is it possible to fetch data posted by my application at some url/file
(e.g.
- http://www.example.com/some.php) by
$_POST?????????

On Apr 24, 5:17 pm, Aakash Bapna <aak...@live.com> wrote:
> Hey,
>
> That happens when you are not URL encoding the string passed in http request.
> please use the encodeURI() function in JS on the POST variable you are passing..
> more on it here->http://www.w3schools.com/jsref/jsref_encodeURI.asp
> Thanks
>
> ~@@k@sh
>
> http://aakash-bapna.blogspot.com
>
>
>
> > Date: Thu, 24 Apr 2008 05:08:15 -0700
> > Subject: [OpenSocial] Re: Post & Get(Very Urgent)
> > From: rose.star.me...@gmail.com
> _________________________________________________________________
> Make i'm yours. Create a custom banner to support your cause.http://im.live.com/Messenger/IM/Contribute/Default.aspx?source=TXT_TA...
Reply all
Reply to author
Forward
0 new messages