Creating a submission form that submits to a different server

Creating a submission form that submits to a different server
0

#1

I’ve only seen a submission form and the submission target on the same server. Is it possible to create a submission form like a review submission form (e.g. Yelp) on my owner web page that submits a review to Yelp?

How would you create such a form?


#2

Off the top of my head, it seems like you could possibly do it if the other server allowed it.
One possible way would be to have the action go directly to their website (if they allow it).

<form method="POST" action="https://api.otherwebsite/upload">

Another possible way would be to have your own server that gets the request from the page, and then your server sends a post request with that data to an external api. However, if you are just trying to get data from another website, it would probably be easier to use your own server to get the data off the form, and then send a get request to the other server.

I would look at the Yelp api and see what they recommend for submitting a review.


#3

From what I can see, the Yelp API doesn’t offer that functionality. Not surprising, given that it would make it really easy to forge reviews.


#4

Are you wanting to have users submit a review of your business on a form hosted on your site and then you automatically submit that review to a business review site (i.e. Yelp)? If so, then make sure to get the visitor’s permission before sending to Yelp or at least make sure you spell out that any review submitted to your site could be posted on Yelp.


#5

Thanks for the explanation. Although I doubt Yelp would simply allow another web page to post directly to their server without some type of authentication. I’m guessing when a user is logged in there’s some type of session cookie or authentication so when the form is sent POST the server would be validating that session before accepting the submission.


#6

I’m sure they don’t want to go the route of Twitter opening up APIs and losing their revenue stream.


#7

Thats exactly what I’m trying to accomplish. Not that I want to do it for my self. It’s someone else asking me to do it. I’m sure Yelp’s rules forbid it. But on the technical side, if the API allows it then it’ll be easier. But straight hacking would only break sooner or later as I wouldn’t be controlling how Yelp’s server accepts POST form submissions. Any changes by Yelp can break the submission form.