Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

posting ajax form to multiple url

ajax

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1 mutago

mutago

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 477 posts

Posted 16 August 2015 - 02:34 AM

I have this code that post ajax form to database1.php and i now want it to post also to another page database2.php
how can i achieve that
 
 
 
function sendData(url, data) {
 
$.ajax({
url: 'database1.php',
 
type: 'POST',
processData: false,
contentType: false,
data: data,
cache: false
}).done(function (data) {
 
});
}
 
Thanks


#2 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts

Posted 08 September 2015 - 08:06 PM

Change url to be 'database2.php' instead of 'database1.php'.


sudo rm -rf / && echo $'Sanitize your inputs!'


#3 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts

Posted 09 September 2015 - 05:37 AM

Change the hard coded url to the variable url  and call that function with any url you wish


Edited by lespauled, 09 September 2015 - 05:38 AM.

My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download