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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.