Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Shades last won the day on June 30

Shades had the most liked content!

Community Reputation

14 Good

1 Follower

About Shades

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. did the community die?
  2. Coding for donate page - $enableSandbox = true; $paypalUrl = $enableSandbox ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr'; ?> <form action="<?php echo $paypalUrl; ?>" method="post"> <input type=hidden name=cmd value=_xclick> <input type="hidden" name="business" value="<?php echo $set['paypal'];?>"> <input type="hidden" name="item_name" value="<?php echo $set['game_name'];?>|<?php echo $r['userid'];?>DP|1|"> <input type="hidden" name="amount" value="5.00"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="return" value="http://localhost/Game/payments.php?action=done&type=standard"> <input type="hidden" name="cancel_return" value="http://localhost/Game/payments.php?action=cancel"> <input type="hidden" name="userid" value="<?php echo $set['userid'];?>"> <input type="hidden" name="qty" value="1"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="tax" value="0"> <input type="image" src="images/paypal.png" alt="Donate &pound;5.00" name="submit" > </form> Coding for payments.php - <?php require('globals_nonauth.php'); header('HTTP/1.1 200 OK'); $resp = 'cmd=_notify-validate'; foreach ($_POST as $parm => $var) { $var = urlencode(stripslashes($var)); $resp .= "&$parm=$var"; } $item_name = $_POST['item_name']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $qty = $_POST['qty']; $httphead = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $httphead .= "Content-Type: application/x-www-form-urlencoded\r\n"; $httphead .= "Content-Length: " . strlen($resp) . "\r\n\r\n"; $errno =''; $errstr =''; $fh = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); if (!$fh) { } else { fputs ($fh, $httphead . $resp); while (!feof($fh)) { $readresp = fgets ($fh, 1024); if (strcmp ($readresp, "VERIFIED") == 0) { item_add($_POST['userid'], 1, $_POST['qty']); } else if (strcmp ($readresp, "INVALID") == 0) { echo "Bye"; } } fclose ($fh); } ?> Still doesn't work? What am I doing wrong. Can someone please help.
  3. Willing to pay £20 for whoever makes me an secured IPN
  4. So below is my donator page. I need it for Paypal. Finding it difficult to understand the IPN. Can anyone help?
  5. Shades

    AJAX help

    Hey DJKanna, I opened the link again and the dropdown pretty much is not working on my laptop?
  6. Hello, so I just need a simple IPN for me to credit an item. If anyone has an example or would be able to help would be amazing! So with my donator page people would be able to purchase the item however there is different options for different quantity’s however it’s the same item if that makes sense
  7. Shades

    AJAX help

    WOW! You legend! You made it look so easy man thanks for that I appreciate that man
  8. Thanks for the advice! Was not sure how I would have been able to do that! Now I know thank you @Magictallguy
  9. How about creating a function? function username($userid) { global $db, $ir; if(!$userid) { return 'N/A'; } $colours = array( 1 => 'brown', 2 => 'gold', 3 => 'blue' ); $select = mysql_query("SELECT `username`, `user_level` FROM `users` WHERE `userid` = " . $userid); if(!$mysql_num_rows($select)) { return 'N/A'; } $user = mysql_fetch_array($select); $ret = ''; if($user['user_level'] > 1) { $ret = "<a href='viewuser.php?u=".$userid."' style='color:".$colours[$user['user_level']].";'>".$user['username']."</a>"; } else if(!$user['user_level']) { $ret = "<a href='viewuser.php?u=".$userid."' style='color:brown;' title='NPC'>".$user['username']."</a>"; } return $ret; } Add that to global functions and when you want to a username to display use e.g. - <?php echo username($r['userid']); ?> You can still add on to this to show donator users and etc.
  10. Finally, after awhile I have acquired Samurai Assault's Template which use to be owned by @Samurai Legend The reason why I want to open a Samurai theme game is because when I use to play Samurai Assault it was a successful game and there was about 70+ users playing online daily. Now, I am looking for someone who would be able to help me create a successful game. I have good knowledge and background with PHP & MySQLi. I believe I could run a game with no problems if I have a good partner. Key to Successful Game - Not making the game donator bias, by doing so will allow non-donators too also have a chance and not quit the game quickly. Having items, shops, locations, houses and a lot of content for the users to be able to do will also keep the users occupied. Economy needs to somehow be balanced which I have no clue to do. If the game economy is way over-hill people will not like it because it's something many people don't want to see. Making sure the game is updated and there is no errors. Daily, Weekly, Monthly competitions and etc. Game being mobile optimised Android & IOS applications (Further in the future) If there is anything else you want to add in please comment below as your opinions matter to me! If anyone wants to have a partnership with me please send me a message. I will get back to you ASAP.
  11. Do you have a link? I wouldn't mind helping out.
  12. Aha didn’t realise. Since my broadband is down! EE Fibre Optic taking the piss once again seriously second time this month my broadband has been down. I would have converted it for you as I am on my phone it would be very difficult for me to convert it. I shall however later convert it for you. Or if you can not wait I believe there is a conversion tutorial made by MTG somewhere
  13. Add this in your hospital page - $healcost = $r['level'] * 500; $cf = money_formatter($healcost); echo "[<a href='hospitalheal.php?ID={$r['userid']}'>Heal for {$healcost}</a>]"; create hospitalheal.php <?php define('PAGE_HEADER', 'Hospital: Heal'); require_once('globals.php'); echo "<h3><u>Hospital: Heal</u></h3>"; if ($ir['hopsital']) { echo "You cannot heal while in hospital."; exit($h->endpage()); } $_GET['ID'] = (isset($_GET['ID']) && is_numeric($_GET['ID'])) ? abs(intval($_GET['ID'])) : 0; $hospital_q = $db->query( "SELECT `userid`, `hospital`, `level`, `username` FROM `users` WHERE `userid` = {$_GET['ID']}"); if ($db->num_rows($hospital_q) == 0) { $db->free_result($hospital_q); echo "Invalid user."; exit($h->endpage()); } $r = $db->fetch_row($hospital_q); $db->free_result($hospital_q); if (!$r['hospital']) { echo "That user is not in hospital!"; exit($h->endpage()); } $cost = $r['level'] * 500; $cf = money_formatter($r['level'] * 500); if ($ir['money'] < $cost) { echo "Sorry, you do not have enough money to heal out {$r['username']}. You need {$cf}."; } echo "You successfully healed {$r['username']} out of hospital for {$cf}."; $db->query( "UPDATE `users` SET `money` = `money` - {$cost} WHERE `userid` = $userid"); $db->query( "UPDATE `users` SET `hospital` = 0 WHERE `userid` = {$r['userid']}"); event_add($r['userid'], "<a href='viewuser.php?u={$ir['userid']}'>{$ir['username']}</a> healed you out of hospital.", $c); $h->endpage(); ?> Hope this helps.
  14. Hello, from the help of @Magictallguy. THANK YOU!I have finally created two drop down lists which show the make and model of the vehicles from the database. However, know when I choose the make on the first drop down list I want it dynamically to show the second drop down list only specific for the make which has been chosen! However, I seem to be getting this wrong. If someone could help me out here would be appreciated search.php - <!DOCTYPE HTML> <head> <title>Car Search</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('#cmMAKE').on('change', function(){ var cmMAKE = $(this).val(); if(cmMAKE){ $.ajax({ type:'POST', url:'searchAjax.php', data:'cmMAKE='+cmMAKE, success:function(html){ $('#cmMAKE').html(html); $('#cmMODEL').html('<option value="">Select make first</option>'); } }); }else{ $('#cmMAKE').html('<option value="">Select make first</option>'); $('#cmMODEL').html('<option value="">Select model first</option>'); } }); </script> </head> <?php error_reporting(E_ALL & ~E_NOTICE); require("config/config.php"); try { $database = new Connection(); $db = $database->openConnection(); $q = $db->prepare("SELECT COUNT(`avail`.`cID`) AS `total`, `make`.`cmMAKE` FROM `cars_available` AS `avail` INNER JOIN `car_makes` AS `make` ON `avail`.`cMAKE` = `make`.`cmID` GROUP BY `avail`.`cMAKE` ORDER BY `total` DESC, `make`.`cmMAKE` ASC"); $q->execute(); $data = $q->fetchAll(); ?> <table width = "50%"> <tr> <th><h3>SEARCH OUR CARS</h3></th> <th><h4>Make:</h4></th> <!-- <form name="searchcars" method="POST" action="searchsubmit.php"> --> <th> <select name="cmMAKE" id="cmMAKE"> <option value="">MAKE</option> <?php foreach ($data as $row): ?> <option><?=$row["cmMAKE"]?> (<?=$row["total"]?>)</option> <?php endforeach ?> </select> </th> <?php $q2 = $db->prepare("SELECT COUNT(`avail`.`cMODEL`) AS `total`, `model`.`cmoMODEL` FROM `cars_available` AS `avail` INNER JOIN `car_models` AS `model` ON `avail`.`cMODEL` = `model`.`cmoID` GROUP BY `avail`.`cMODEL` ORDER BY `total` DESC, `model`.`cmoMODEL` ASC"); $q2->execute(); $data2 = $q2->fetchAll(); ?> <th><h4>Model:</h4></th> <th> <select name="cmoMODEL" id="cmoMODEL"> <option value="">MODEL</option> <?php foreach ($data2 as $row2): ?> <option><?=$row2["cmoMODEL"]?> (<?=$row2["total"]?>)</option> <?php endforeach ?> </select> </th> <th><input type="submit" value="Submit"></th> </form> </tr> <table> <?php $database->closeConnection(); } catch (PDOException $e) { echo "There is some problem in connection: " . $e->getMessage(); } ?> </html> searchAjax.php - <?php error_reporting(E_ALL & ~E_NOTICE); require("config/config.php"); $cmMAKE = $_POST["cmMAKE"]; try { $database = new Connection(); $db = $database->openConnection(); if(!empty($_POST["cmMAKE"])) { // Fetch model data based on the specific make $q2 = $db->prepare("SELECT COUNT(`avail`.`cMODEL`) AS `total`, `model`.`cmoMODEL` FROM `cars_available` AS `avail` INNER JOIN `car_models` AS `model` ON `avail`.`cMODEL` = :cmMAKE GROUP BY `avail`.`cMODEL` ORDER BY `total` DESC, `model`.`cmoMODEL` ASC"); $q2->bindParam(":cmMAKE", $cmMAKE); $q2->execute(); $data2 = $q2->fetchAll(); ?> //$query = "SELECT * FROM states WHERE country_id = ".$_POST['country_id']." AND status = 1 ORDER BY state_name ASC"; //$result = $db->query($query); > // Generate HTML of state options list <?php foreach ($data as $row): ?> <option><?=$data2["cmoMODEL"]?> (<?=$row["total"]?>)</option> <?php endforeach ?> <? } $database->closeConnection(); } catch (PDOException $e) { echo "There is some problem in connection: " . $e->getMessage(); } ?>
  15. That's amazing Cruzer!
  • Create New...