graham23s Posted August 14, 2009 Share Posted August 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
corbin Posted August 14, 2009 Share Posted August 14, 2009 Why not have the popup page do it? You could just pass it the variables. If you don't want to do it that way, you'll have to use AJAX. Quote Link to comment Share on other sites More sharing options...
graham23s Posted August 15, 2009 Author Share Posted August 15, 2009 Hi Corbin, affURL is an actual url that gets loaded into the browser that's made, can i still do it that way even though i'm not actually loading a .php file to show the popup? cheers mate Graham Quote Link to comment 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.