Jump to content

emery

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

emery's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, thank you, this is what i have but it does not work ... <?php RANDOMIZE TIMER $N = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824"; $A = "20120731"; N = INTVAL(rand(10, 91); ECHO N; $B = SUBSTR(N$, N, ; $C = ""; for ($a=1; $a<=8; $a++) { X = INTVAL(SUBSTR($A, A, 1)) + INTVAL(SUBSTR(B$, A, 1)); IF (X > 9) { X = X - 10; } $C = $C . X; } $C = N . $C; echo $c; ?>
  2. Ok, i have gotten this far, but how do i do the loop for next? <?php RANDOMIZE TIMER $N = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824"; $A = "20120731"; N = INTVAL(rand(10, 91); ECHO N; $B = SUBSTR(N$, N, ; $C = ""; FOR A = 1 TO 8 X = INTVAL(SUBSTR($A, A, 1)) + INTVAL(SUBSTR(B$, A, 1)); IF (X > 9) { X = X - 10; } $C = $C . X; NEXT $C = N . $C; echo $c; ?>
  3. Could you please help :'(
  4. <?php RANDOMIZE TIMER $N = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824"; $A = "20120731"; N = INT(RND(9) * 81 + 10); ECHO N; $B = MID$(N$, N, ; $C = ""; FOR A = 1 TO 8 X = VAL(MID$(A$, A, 1)) + VAL(MID$(B$, A, 1)) IF (X > 9) { X = X - 10; } $C = $C . LTRIM$(STR$(X)) NEXT $C = LTRIM$(STR$(N)) . $C; echo $c; ?> That is what i have now, but i don't know how to change the rest
  5. It just kinda felt like being there .... bad poker face.jpg
  6. Noo, it's for my software, i have the code in quick basic, but i need the code in php, which i don't know much of proof: COLOR 15, 1: CLS 'ENCRYPT A$ -> C$ RANDOMIZE TIMER N$ = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824" A$ = "20120731" N = INT(RND(9) * 81 + 10) PRINT N B$ = MID$(N$, N, C$ = "" FOR A = 1 TO 8 X = VAL(MID$(A$, A, 1)) + VAL(MID$(B$, A, 1)) IF X > 9 THEN X = X - 10 C$ = C$ + LTRIM$(STR$(X)) NEXT C$ = LTRIM$(STR$(N)) + C$ PRINT C$ 'DECRYPT C$ -> A$ RANDOMIZE TIMER N$ = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824" N = VAL(LEFT$(C$, 2)) C$ = RIGHT$(C$, B$ = MID$(N$, N, A$ = "" FOR A = 1 TO 8 X = VAL(MID$(C$, A, 1)) - VAL(MID$(B$, A, 1)) IF X < 0 THEN X = X + 10 A$ = A$ + LTRIM$(STR$(X)) NEXT PRINT A$
  7. I nee an encryption code for php that will do this, if someone could write it i would be more then happy! This is how to decode it, if you can figure out ow to encode it that would be awsome longstring = "6804564035410064404403402418540676879840602880370546710354657057035406870564064340640810564097523824" To decode you peal off the first two digits from C$ and use that to relocate the position of the first digit in the long string. Then take it and the next 7 digits to make B$. Falsely subtract C$ minus B$ and you get the date back in A$.
  8. Could anyone please transform this code to normal mysql instead of mysqli, i am not familure with mysqli and it does not work on my server <?php // Helper method to get a string description for an HTTP status code // From http://www.gen-x-design.com/archives/create-a-rest-api-with-php/ function getStatusCodeMessage($status) { // these could be stored in a .ini file and loaded // via parse_ini_file()... however, this will suffice // for an example $codes = Array( 100 => 'Continue', 101 => 'Switching Protocols', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => '(Unused)', 307 => 'Temporary Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported' ); return (isset($codes[$status])) ? $codes[$status] : ''; } // Helper method to send a HTTP response code/message function sendResponse($status = 200, $body = '', $content_type = 'text/html') { $status_header = 'HTTP/1.1 ' . $status . ' ' . getStatusCodeMessage($status); header($status_header); header('Content-type: ' . $content_type); echo $body; } function redeem() { // Check for required parameters if (isset($_POST["rw_app_id"]) && isset($_POST["code"]) && isset($_POST["device_id"])) { // Put parameters into local variables $rw_app_id = $_POST["rw_app_id"]; $code = $_POST["code"]; $device_id = $_POST["device_id"]; // Look up code in database $user_id = 0; $stmt = $this->db->prepare('SELECT id, unlock_code, uses_remaining FROM rw_promo_code WHERE rw_app_id=? AND code=?'); $stmt->bind_param("is", $rw_app_id, $code); $stmt->execute(); $stmt->bind_result($id, $unlock_code, $uses_remaining); while ($stmt->fetch()) { break; } $stmt->close(); // Bail if code doesn't exist if ($id <= 0) { sendResponse(400, 'Invalid code'); return false; } // Bail if code already used if ($uses_remaining <= 0) { sendResponse(403, 'Code already used'); return false; } // Check to see if this device already redeemed $stmt = $this->db->prepare('SELECT id FROM rw_promo_code_redeemed WHERE device_id=? AND rw_promo_code_id=?'); $stmt->bind_param("si", $device_id, $id); $stmt->execute(); $stmt->bind_result($redeemed_id); while ($stmt->fetch()) { break; } $stmt->close(); // Bail if code already redeemed if ($redeemed_id > 0) { sendResponse(403, 'Code already used'); return false; } // Add tracking of redemption $stmt = $this->db->prepare("INSERT INTO rw_promo_code_redeemed (rw_promo_code_id, device_id) VALUES (?, ?)"); $stmt->bind_param("is", $id, $device_id); $stmt->execute(); $stmt->close(); // Decrement use of code $this->db->query("UPDATE rw_promo_code SET uses_remaining=uses_remaining-1 WHERE id=$id"); $this->db->commit(); // Return unlock code, encoded with JSON $result = array( "unlock_code" => $unlock_code, ); sendResponse(200, json_encode($result)); return true; } sendResponse(400, 'Invalid request'); return false; } // This is the first thing that gets called when this page is loaded // Creates a new instance of the RedeemAPI class and calls the redeem method $api = new RedeemAPI; $api->redeem(); ?>
  9. emery

    Confused

    Please remove this, or atleast all code or words regarding "Dhpos Self Checkout" Regards, Emery
  10. Thanks, i have done this but my hosting has gone down for about 24hours :'(
  11. The site is at http://snowblazers.tk snow = { count: 60, delay: 10, flutter: 0.2, wind: 1.0, w1: 1, minSpeed: 0.3, maxSpeed: 4, cv: null, flakes: [], toggle: function() { if(window.snowtimer) snow.stop(); else snow.start(); }, resize: function() { snow.cv.width = innerWidth; snow.cv.height = innerHeight; snow.gt = snow.ct.createLinearGradient(0,0,0,snow.cv.height); snow.gt.addColorStop(0.0, '#6666ff'); snow.gt.addColorStop(1.0, '#ffffff'); snow.ct.fillStyle = snow.gt; }, start: function() { snow.cv = document.createElement('canvas'); snow.cv.width = snow.cv.height = 10; // set initial size snow.cv.id = 'backgroundSnowCanvas'; document.body.appendChild(snow.cv); snow.createFlake(); snow.ct = snow.cv.getContext('2d'), snow.cv.style.position = 'absolute'; snow.cv.style.top = 0; snow.cv.style.left = 0; snow.cv.style.zIndex = -1; snow.resize(); var c = snow.count; snow.flakes = []; do { snow.flakes.push(new snow.flake()); } while(--c); snow.ct.fillRect(0,0,snow.cv.width,snow.cv.height); window.snowtimer = window.setInterval(snow.draw, snow.delay); window.addEventListener('resize',snow.resize); }, stop: function() { window.clearInterval(window.snowtimer); var c = document.getElementById('backgroundSnowCanvas'); c.parentNode.removeChild(c); window.snowtimer=snow=null; }, draw: function() { var ct = snow.ct, f = snow.flakes, c = snow.count; ct.fillRect(0,0,snow.cv.width,snow.cv.height); do { if(f[--c].draw(ct) && ++fdone) { }; } while(c); snow.wind += Math.cos(snow.w1++ / 180.0); }, flake: function() { this.draw = function(ct) { ct.drawImage(snow.flakeImage,this.x + snow.wind,this.y,this.sz,this.sz); this.animate(); }; this.animate = function() { this.y += this.speed; this.x += this.flutter * Math.cos(snow.flutter * snow.flutter * this.y); if(this.y > innerHeight) this.init(1); }; this.init = function(f) { this.speed = snow.minSpeed + (Math.random() * (snow.maxSpeed - snow.minSpeed)); this.sz = ~~(Math.random() * 40) + 20; this.flutter = ~~(Math.random() * snow.flutter * (60-this.sz)); this.x = (Math.random() * (innerWidth + this.sz)) - this.sz; this.y = f ? -this.sz : Math.random() * innerHeight; }; this.init(); }, createFlake: function() { snow.flakeImage = document.createElement('canvas'); snow.flakeImage.width = snow.flakeImage.height = 40; var c = snow.flakeImage.getContext('2d'); c.fillStyle = '#fff'; c.translate(20,20); c.beginPath(); c.rect(-5,-20,10,40); c.rotate(Math.PI / 3.0); c.rect(-5,-20,10,40); c.rotate(Math.PI / 3.0); c.rect(-5,-20,10,40); c.closePath(); c.fill(); }, };
  12. What ??? What do I attach it to? And I will post the .js file when I can (10hrs) approx
  13. I have this code It doesn't work in IE but works in chrome/FF <script src="snow.js" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ window.onload = function() { try { snow.count = 30; // number of flakes snow.delay = 20; // timer interval snow.minSpeed = 2; // minimum movement/time slice snow.maxSpeed = 5; // maximum movement/time slice snow.start(); } catch(e) { // no snow } }; //]]> </script>
×
×
  • 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.