probbins222
probbins222

Reputation: 119

AppEngine redirect

I am running some javascript code from a local appengine instance and trying to use a php proxy to do some ajax calls. The js call looks like:

url = "proxy.php?url=http://www.example.com?format=json";
xmlhttp.open("GET",url,true);
xmlhttp.send();

In the appengine configuration, I am having trouble having it follow the path to the php proxy. I have this code:

class Proxy(Page):
def get(self):
self.redirect('/proxy.php', {})

The problem is that the query parameters are not being passed through the redirect. any help is appreciated.

Upvotes: 0

Views: 581

Answers (3)

Romain Poussier
Romain Poussier

Reputation: 1

App Engine can run PHP ; It's just recent, so there is only few modules that you will be able to run on. (sorry for the late answer :( ) https://cloud.google.com/appengine/docs/php/

Upvotes: 0

probbins222
probbins222

Reputation: 119

Closing as I realize that appengine cannot run PHP.

Upvotes: 0

Michael Manoochehri
Michael Manoochehri

Reputation: 7877

Sorry, it's not clear to me what you are trying to do. Are you trying to pass a string to the request handler to redirect to your PHP script on another domain?

class MyRequestHandler(webapp.RequestHandler):
    def get(self, url):
      self.redirect('http://somedomain.com/proxy.php?url=%s' % url)

application = webapp.WSGIApplication([('/redirect_to/(.*)', MyRequestHandler)])

Upvotes: 1

Related Questions