![Confundido](http://static.forosdelweb.com/fdwtheme/images/smilies/confused.png)
| |||
Problema con update para que incremente +1 la base de datos. Hola miren los que necesito es que al darle a un boton este abra una pagina donde este un php y al ejecutarse se acredite +1 en una fila de mi base de datos.o si fuera q al darle a un boton comienza a acreditarse +1 cada cierto tiempo mejor.Tenia el codigo pero lo perdi. ![]() |
| |||
Respuesta: Problema con update para que incremente +1 la base de datos. Hola carlossic17, Esto es un foro de ayuda y no un taller donde vayamos a fabricarlo. Crea el código, y publica tus dudas o problemas. ![]() |
| |||
Respuesta: Problema con update para que incremente +1 la base de datos. Tengo esto amigo pero no es php <script type="text/javascript"> var earnings = <?php echo $row_Usuarios['earnings']; ?>; var currentUrl = null; var urls = new Array(); var adids = new Array(); var timer = 49; var currentWindow; var intervalId = null; $(document).ready(function() } $("#viewad").button({ icons: { primary: "ui-icon-play" } }).hide(); $('#earnings').html('$'+roundNumber(earnings,6)); $('#earnings').hide(); $('#start-surfing').bind('click', function() { $("#dialog-message").dialog({ modal: true, width: 700, title: 'Surf Ads', resizable: false, draggable: false }); $("#viewad").show(); }); $("#viewad").bind('click',function() { $('#earnings').show(); $("#viewad").hide(); // we have to open it here on the click event to protect against b10ck3r in ch0r0me... currentWindow = window.open('youtube_auto_credit.php?start=y&sid=& sid2=&siduid=0', 'videoad', ',type=fullWindow,fullscreen,scrollbars=yes', false); window.blur(); window.focus(); nextUrl(); }); }); function isWindowClosed() { if (!currentWindow || typeof currentWindow == 'undefined' || currentWindow && currentWindow.closed) { return true; } else { return false; } } function roundNumber(num, dec) { var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); return result; } function increaseEarnings() { $earnings = $earnings + 1; $('#earnings').html('$'+Math.round(earnings,<?php echo $row_Usuarios['earnings']; ?>)); } Object.size = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; }; function nextUrl() { $.get("youtube_auto_credit.php" + '?next=go&sid=&sid2=&siduid=0',function(data){ timer = Math.round(data.timer/10); $('#timer').html(timer); if(data.status == 'MAX_CLICKS') { doneSurfing(); } else if(data.status == 'TOO_FAST') { alert('You are surfing too fast!'); } else if(data.status == 'LOGIN') { alert('You are not logged in'); } else { //alert(data.url); //if(typeof data.url=='undefined') //{ //alert('Sorry, the server is having issues, please try again later by refreshing this page.'); //} //else //{ if(isWindowClosed()) { currentWindow = window.open(data.url, 'videoad', ',type=fullWindow,fullscreen,scrollbars=yes', false); window.blur(); window.focus(); } else { currentWindow.location = data.url; increaseEarnings(); } setInterval(increaseEarnings, 5000); setTimeout(action, timer * 5000); //} } },'json'); } function doneSurfing() { url = '<?php echo $row_earnings['url']; ?>'; currentWindow.location = url; } function progresscount(time) { if(time == 0) { if(isWindowClosed() == true) { $("#dialog-message").dialog('close'); } else { nextUrl(); } } else { intervalId = setInterval(bip, 1000); setTimeout(action, time * 1000); } } </script> |
Etiquetas: |