Jump to content

AdamHull12

New Members
  • Posts

    9
  • Joined

  • Last visited

AdamHull12's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yes that what is happening. This is someone elses codde i am trying to clean up
  2. 1) Yes it is in test.php, 2)if the if statement is false then it will not pass down into the else statement it just prints the if no matter what. 3) I have put in the php error checking and nothing is displayed
  3. hello, i have this function, function withdraw() { global $db,$ir,$c,$userid; if($_POST['amount'] > $ir['bankmoney']) { echo '<span style="color:red;">You dont have enough money saved to withdraw that much!</span>'; } else { $db->query("UPDATE `users` SET `bankmoney` = `bankmoney` - ".$_POST['amount'] .", `money` = `money` + " . $_POST['amount'] . " WHERE `userid` = ".$userid); $ir['money'] += $_POST['amount']; echo 'You withdrew ' . money_formatter($_POST['amount'] + 0) . ' into your hand from your account.<br/> You know have ' . money_formatter($ir['money'] + 0) . ' in your hand.'; } } that does not seem to work correctly it will not seem to move past the first if statement even if the amount is less then the bank mone. the form which submits this is <a href="test.php?withdraw" target="_blank">>Withdraw</a><br/>'; if (isset($_GET['withdraw'])== 1){ echo' <div id="withdraw" style="background: #ffffd3;border: 1px #ffff99 solid;padding: 20px;width: 250px;margin: 5px;"> <form action="" method="post" onsubmit="makeTrans(\'withdraw\');return false;"><input type="text" name="withdraw" value="'.($ir['bankmoney']).'" /> <input type="submit" value="Withdraw" /></form> <div id="withdraw_callback"> Please select the amount you wish to withdraw then hit the withdraw button next to it. </div> </div> '; thanks
  4. Hi, I am struggling to get a htmnl 5 canavas not to work after the back button is pressed in the browser. I have stopped back button being allowed but it stops me using javascript to use go back which i need. The code is as follows. <?php require('globals.php'); if ($ir['wof_spins'] > 0) { error("You have span the wheel this hour"); //this does not work on page back } ?> <!DOCTYPE html> <html> <head><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <script type='text/javascript' src='http://code.jquery.com/jquery-compat-git.js'></script> <script type='text/javascript' src="js/jquery.transit.min.js"></script> <style type='text/css'> .wheel-wrap { position: relative; width: 550px; height: 550px; overflow: hidden; margin: 0 auto; z-index: 1; } .marker { top: 10px; left: 247px; z-index: 1; position: absolute; } .wheel { top: 90px; left: 74px; width: 550px; z-index: 1; } </style> <script type='text/javascript'>//<![CDATA[ $(function(){ window.WHEELOFFORTUNE = { cache: {}, init: function () { console.log('controller init...'); var _this = this; this.cache.wheel = $('.wheel'); this.cache.wheelMarker = $('.marker'); this.cache.wheelSpinBtn = $('.wheel'); //mapping is backwards as wheel spins clockwise //1=win this.cache.wheelMapping = [400, 120, 80, 750, 150, 300, 60, 175, 500, 125, 75, 1000, 120, 200, 90, 600, 100, 250].reverse(); this.cache.wheelSpinBtn.on('click touchstart', function (e) { e.preventDefault(); if (!$(this).hasClass('disabled')) _this.spin(); }); //reset wheel this.resetSpin(); //setup prize events this.prizeEvents(); }, spin: function () { console.log('spinning wheel'); var _this = this; // reset wheel this.resetSpin(); //disable spin button while in progress this.cache.wheelSpinBtn.addClass('disabled'); /* Wheel has 10 sections. Each section is 360/10 = 36deg. */ var deg = 1500 + Math.round(Math.random() * 1500), duration = 6000; //optimal 6 secs _this.cache.wheelPos = deg; //transition queuing //ff bug with easeOutBack this.cache.wheel.transition({ rotate: '0deg' }, 0) .transition({ rotate: deg + 'deg' }, duration, 'easeOutCubic'); //move marker _this.cache.wheelMarker.transition({ rotate: '-20deg' }, 0, 'snap'); //just before wheel finish setTimeout(function () { //reset marker _this.cache.wheelMarker.transition({ rotate: '0deg' }, 300, 'easeOutQuad'); }, duration - 500); //wheel finish setTimeout(function () { // did it win??!?!?! var spin = _this.cache.wheelPos, degrees = spin % 360, percent = (degrees / 360) * 100, segment = Math.ceil((percent / 6)), //divided by number of segments win = _this.cache.wheelMapping[segment - 1]; //zero based array console.log('spin = ' + spin); console.log('degrees = ' + degrees); console.log('percent = ' + percent); console.log('segment = ' + segment); console.log('win = ' + win); //display dialog with slight delay to realise win or not. setTimeout(function () { $.ajax({ url: 'spinwheel.php', type: 'post', data: {"win":win}, success: function(data) { if(!alert('You have won 짜'+win)) document.location = 'http://samuraiassault.com/loggedin.php'; } }); }, 700); //re-enable wheel spin _this.cache.wheelSpinBtn.removeClass('disabled'); }, duration); }, resetSpin: function () { this.cache.wheel.transition({ rotate: '0deg' }, 0); this.cache.wheelPos = 0; } } window.WHEELOFFORTUNE.init(); });//]]> </script> </head> <body> <!-- By http://jquery4u.com / Sam Deering --> <h3><u>Wheel Of Fortune</u></h3><hr/> <table><tr> <td class="contentcontent" width="100%"> <div class="wheel-wrap"> <img class="wheel" src="images/wheel.jpg" /> <img class="marker" src="images/marker.png" /> </div> </tr> </td> </table><hr/><?php echo $goback; ?><hr/> </body> </html> thanks for you help in advance
  5. I have fixed i just realised i declared it as post and not server
  6. Column 'signup_IP' cannot be null but it is defined by the $_POST['REMOTE_ADDR']
  7. Hello, I have this code <?php $stmt = $db->prepare("INSERT INTO `members` (`playername`,`player_login_name`,`player_login_pass`,`my_email`, `my_gender`,`signup_IP`,`signup_time`) VALUES(?,?,?,?,?,?,?)"); $stmt->bind_param("ssssssi",$_POST['email'],$_POST['email'],md5($_POST['pass']),$_POST['email'],$_POST['gender'],$_POST['REMOTE_ADDR'],time()); $stmt->execute(); $stmt->close(); ?> and i will not insert into my database. I have check the syntax and there is no error, can anyore help me thanks
  8. Hello, I am quite new to the php and website scene and i am trying to find the best way to validate and sterilize my $_post the way i have come up with is $id = filter_var(mysql_real_escape_string($_POST['id']),FILTER_SANITIZE_NUMBER_INT); or $id = mysql_real_escape_string($_POST['id']); $id1 = filter_var($id,FILTER_SANITIZE_NUMBER_INT); which will be the best way to do it or is there a better way. Thanks
×
×
  • 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.