Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Will you post your php script?

Received: by 10.220.201.194 with SMTP id fb2mr2060529vcb.17.1285530458150;
        Sun, 26 Sep 2010 12:47:38 -0700 (PDT)
X-BeenThere: apitoolbox@googlegroups.com
Received: by 10.220.84.2 with SMTP id h2ls274746vcl.0.p; Sun, 26 Sep 2010
 12:47:37 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.53.1 with SMTP id k1mr97787vcg.11.1285530457233; Sun, 26
 Sep 2010 12:47:37 -0700 (PDT)
Received: by a9g2000yqg.googlegroups.com with HTTP; Sun, 26 Sep 2010 12:47:37
 -0700 (PDT)
Date: Sun, 26 Sep 2010 12:47:37 -0700 (PDT)
In-Reply-To: <af2e0242-3ab6-4ffd-87d4-8cd3c122c1aa@y11g2000yqm.googlegroups.com>
X-IP: 95.21.105.131
References: <00648e3d-0b45-4142-a46e-bb1f59aff831@28g2000yqm.googlegroups.com>
 <68b875e0-7055-42dd-b956-0f851c7ba612@j18g2000yqd.googlegroups.com>
 <d15e96c5-c75f-4597-98ff-6657038220d0@k10g2000yqa.googlegroups.com> <af2e0242-3ab6-4ffd-87d4-8cd3c122c1aa@y11g2000yqm.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)
 AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/532.5,gzip(gfe)
Message-ID: <da49d720-3cae-4701-8d2a-194cde6dca8a@a9g2000yqg.googlegroups.com>
Subject: Re: Will you post your php script?
From: Eureka <lucasact...@gmail.com>
To: API Toolbox <apitoolbox@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

What i was trying to say is that at the moment I use js to call google
function because I didn't know how to use it with php but now this
code really helps me a lot. Now I can do all I want it with php. Ommit
my last question, it was a silly question. I have test it your php
code and now I can use long strings. With this code the error of the
Get is resolved but I was asking me what are the headers for. Also I'd
like to know if you know how to wait until google has the answer, I
mean, in js you can do:

google.language.translate(text, "en", "fr", function(result) {
	document.getElementById('someelement').value =3D result.translation;
	YOUR NEXT CODE AFTER YOU HAVE THE ANSWER
});

is it possible on php?

On Sep 26, 9:19=A0pm, Vision Jinx <vjn...@gmail.com> wrote:
> Hello,
>
> I am not clear on your question or what you really mean by post error.
> This script is intended to be used dynamically like with AJAX
> requests. You can check out this page as it demonstrates more what
> this script was for.
>
> http://www.visionjinx.net/miniapps/glang.htm
>
> With that being said, it really would not be hard at all to parse the
> JSON data (returned from Google) using PHP also, instead of just
> returning the JSON string back to your AJAX callback handler like I
> have done in the above link.
>
> Cheers!
> Vision Jinx
>
> On Sep 26, 12:05=A0pm, Eureka <lucasact...@gmail.com> wrote:
>
>
>
> > Oh thanks for your code. In fact it's better for me to have the answer
> > in the php file, I mean, I don't need to use the code in js, I can do
> > what I want in php so with this curl acces, Do I have the "post error"
> > fixed?
>
> > On Sep 26, 6:45=A0pm, Vision Jinx <vjn...@gmail.com> wrote:
>
> > > Hello,
>
> > > The script I am using is a custom one for my site, but here is the
> > > basics for you
>
> > >http://paste-it.net/public/e417b17/
>
> > > This is for use with an AJAX Post request. You send the post request
> > > to this script, it will use PHP Curl to get the JSON data from Google=
,
> > > then return the JSON string back to your AJAX callback handler.
>
> > > I did notice after I pasted it that I missed adding the userip param
> > > (which Google now requires) so you will want to add that, but I think
> > > the code is pretty self explanitory and you should not have any
> > > problems going through the comments I made for it.
>
> > > Cheers!
> > > Vision Jinx
>
> > > On Sep 26, 10:12=A0am, Eureka <lucasact...@gmail.com> wrote:
>
> > > > Hi!
>
> > > > I'm trying to call google's API to translate some text. Looking for
> > > > the web I only found that you code a php script to send data with P=
OST
> > > > method in order to avoid the GET limitation. I'm wondering to know =
if
> > > > you will post your php script to avoid this error or at last if you
> > > > could help me with my php code to avoid it.
>