Jump to content

Update mysql from js function


graham23s

Recommended Posts

Hi Guys,

 

What i'm attempting to do is update a mysql database through a javascript function, so when i click on <a href='onclick="return myfunction();"'></a>

 

function myfunction(affURL)
{

if (confirm('You will now be redirected to the purchase page, continue?'))
{

  // Need a way to log things, update mysql with vars passed through
  

  var l   = screen.availWidth / 2 - 450;
  var t   = screen.availHeight / 2 - 320;
  var win = window.open(affURL, 'payPopupMain', 'width=900,height=650,left='+l+',top='+t+',scrollbars=1');

} else {

  // Send them back to the payment.php page
  window.location('payment.php');

}

}

 

The code above opens up a browser for the user, but i also want to update mysql without the user seeing any of it, so all they see if the browser popup, and behind the scenes the script updates mysql with a few variables

 

any help on what i would need to do would be appeciated.

 

thanks guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/170305-update-mysql-from-js-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.