Jump to content

Magictallguy

Administrators
  • Content Count

    1,939
  • Joined

  • Last visited

  • Days Won

    73

Magictallguy last won the day on October 13

Magictallguy had the most liked content!

Community Reputation

303 Excellent

About Magictallguy

  • Rank
    Intermediate
  • Birthday 08/07/1991

Personal Information

  • Location
    Bolton, UK
  • Occupation
    Freelance Website Developer

Recent Profile Visitors

16,788 profile views
  1. Offending line: isset() returns a boolean. This will always succeed. if ( isset($data['yesorno']) // check var existence && $data['yesorno'] === 'yes' // check it *exactly* equals yes ) // Same as above, but as one line if (isset($data['yesorno']) && $data['yesorno'] === 'yes')
  2. Because they are? Nice work on the template though, a little bit o' nostalgia juice!
  3. Lines 97 and 106 of ipn_donator.php, and line 39 of the addition to itemuse.php make calls to mysql_error(). In PHP7, mysql_*() functions don't exist. In this instance, those calls can be safely removed
  4. Yes, it can! It would take a little work to be at strict PHP7.4 standards, but it's definitely possible
  5. Please copy and paste your code - a screenshot of it can make it harder to debug. On line 101, you have a variable `$garage` which does not appear to have been defined within that function or passed in via function parameters or global scoping. The code implies that it's supposed to send an error message if `$garage['GA_exhaust']` doesn't match the DB result, however, the code actually reads as setting an array key within the `$garage` var but doesn't use it. On line 112, you have another seemingly undefined variable `$value`. I've split the logics combining non-existent row with user doesn't own. What happens after trying this? (Note: Written in English. Hungarian is not a strong point of mine) public function method_exhaust() { // Get vehicle and adjoining garage data $stmt = $this->db->prepare('SELECT * FROM garage INNER JOIN cars ON CA_id = GA_car WHERE GA_id = :car '); $stmt->bindParam(':car', $this->methodData->car); $stmt->execute(); $car = $stmt->fetchObject(); if(empty($car)) { // row not found $this->alerts[] = $this->page->buildElement('error', ['text' => 'Car doesn\'t exist']); } elseif ($car->GA_uid != $this->user->id) { // row doesn't belong to user $this->alerts[] = $this->page->buildElement('error', ['text' => 'Car isn\'t yours']); } elseif ($garage['GA_exhaust'] != $this->garage->info->GA_exhaust) { // selected car part doesn't match garage entry $this->alerts[] = $this->page->buildElement('error', ['text' => 'Mismatched parts']); } elseif ($value > $this->user->info->US_money) { // Not enough money $this->alerts[] = $this->page->buildElement('error', ['text', 'Not enough money. $'.number_format($value).' required']); } else { // Make purchase // Update garage $garage = $this->db->prepare('UPDATE garage SET GA_exhaust = GA_exhaust + 100 WHERE GA_id = :id'); $garage->bindParam(':id', $car->GA_id); $garage->execute(); // Take cost $money = $this->db->prepare('UPDATE userStats SET US_money = US_money - 1000000 WHERE US_id = :id'); $money->bindParam(':id', $this->user->id); $money->execute(); // Hook it $actionHook = new hook('userAction'); $actionHook->run([ 'user' => $this->user->id, 'module' => 'tuning.exhaust', 'id' => $car->CA_id, 'success' => true, 'reward' => $value, ]); } }
  6. Quite unlikely to be an attack then. I'll give the class another look
  7. That's the "replace BBC with HTML" part. As-is, that part is fine. Something is adding the eval flag to the parse. Suggestion: Check the content you're attempting to convert - you may have someone attempting to do something they shouldn't
  8. "Column count doesn't match value count" - you're attempting to insert 10 values into a table that doesn't have 10 columns. Alter the query to insert the correct amount of values (in the correct order), or add named values*. * INSERT INTO table_name (col_1, col_2, col_3) VALUES ('some', 'values', 'here')
  9. I once turned a Sony Xperia XA2 into a portable fileserver, but not a webserver. That being said, I haven't owned any kind of mobile device for about a year now and code from my desktop only
  10. Heh, we ended up doing something quite similar. Nicely done! 🙂
  11. Magictallguy

    GRPG

    There's very little change in frontend design. The majority of the work was behind the scenes
  12. Not quite what he was asking. He's after the brain bit behind it (the bit on your site)
  13. Are you wanting to work with someone, or are they working for you?
  14. The original image is an SVG. PHP doesn't have any native image handling libraries and GD (usually compiled with PHP by default these days) can't support the SVG format. If you've got Imagick installed, then you're good to go. If not, then I recommend a 3rd party service such as CloudConvert, they have an API exposed (in a format you're more accustomed to, Sim) that allows you to convert on-demand from within your own site.
×
×
  • Create New...