sticksstones Posted March 30, 2012 Share Posted March 30, 2012 A business I do freelance work for has formed an alliance with another larger company. I've been asked to scrape details and ultimately a form, from our alliance parters website where they use (I assume) a cms system to display both their and our up and coming events on their website. I've been able to scrape their form onto our website and the information sends to their form-handling script perfectly (they've emailed me back to confirm my test messages), but (as I understand it) their script returns a redirect which throws a 303 error on our site. My problem is that i want the user to remain on our site and not be redirected onto one of their pages. I've used simplehtmldom to scrape and a jquery $.ajax post to send the data, but I'm getting out of my depth as a programmer. I'd really appreciate some help! Thanks var form = $('.bookingform'); var data = form.serialize(); $('#result').html("Sending information"); $.ajax({ url:"http://www.allianceparter.com/handleform.aspx?form=2", type:'POST', data:data, dataType:'json', success:function(outputData) { $('#result').html("Your message has been sent"); }, error:function(xhr, status, errorThrown) { $('#result').html("Error: Failed to send "); } }); Quote Link to comment https://forums.phpfreaks.com/topic/259980-what-to-do-with-a-303/ Share on other sites More sharing options...
Adam Posted March 30, 2012 Share Posted March 30, 2012 At what stage is the redirect happening? XHR requests should just follow them as usual and return the result of the end request. Quote Link to comment https://forums.phpfreaks.com/topic/259980-what-to-do-with-a-303/#findComment-1332751 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.