Jump to content
MakeWebGames

~Rob0t

Members
  • Posts

    118
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by ~Rob0t

  1.   Don't use INT(11) for everything Why so many hard-coded values? Why are you using mysql_real_escape_string() on an integer value? See this Your indentation is horrible. Have a look at PSR-2 coding standards or even this wikipedia article Line 433 is funny Read this reply to your original post from [MENTION=65371]sniko[/MENTION], then recode it entire thing.
  2. Off-topic, but you do realise that Laravel does supply a micro-framework - http://lumen.laravel.com/ which would only involve the core and not any helpers or libraries.
  3. A good framework - which takes into consideration future-proofing - will involve; Class abstraction Class namespacing Class interfaces Class inheritance Ability to support multiple DBMS; including SQL and noSQL A suitable directory structure Excessive documentation on code methodology and conventions General use utilities and libraries - both extendible (Generally speaking) MVC design pattern (or even MVVMC - basically a separation of business logic (incl. business rules), view logic and routing Some tight security, addressing various vulnerabilities, such as session hijacking, file uploads, data validation, data sanitisation, etc... A testing suite (incl. performance tools) - unit testing, integration testing, component interface testing, system testing, OA testing, caching and benchmarking   The fundamentals of object-oriented programming is a somewhat "easy" task to comprehend, but the implementation isn't "quiet easy" if you were to focus on the above points and produce a valuable piece of software.   Sounds like a library and not a framework. http://stackoverflow.com/questions/148747/what-is-the-difference-between-a-framework-and-a-library
  4. Heh, goodluck with that. It's favoured a lot on a CV (if you were to enter a professional establishment) that you had experience with a popular framework. But, if you do develop your own framework, this GIF is appropriate; Though there are some pro's for doing your own framework, in my experience, they don't outdo the cons; http://programmers.stackexchange.com/a/35927/112871
  5. Yeah, like a new Javascript lib/framework being released almost daily. Some funny tweets :)           Basically all these
  6. Yes, I would assume that's what he was implying. However, I wouldn't make it plural. Learn one framework inside and out and become efficient in it. Why just one? In a professional environment, you won't (realistically) work on multiple projects running multiple frameworks - unless management/upper-development make an avalanche from a simple snow ball. If you're stuck on which to learn, have a read of this list on SitePoint. All popular frameworks have excellent documentation and employ the best (or a variant of) practices throughout. This GitHub repo lists the popular frameworks and links to their respective GitHub repositories.
  7. You should look into prepared statements. There's no need to run your session value - that is holding an id - with abs() - unless of course it can be modified by the user (and I don't mean by session poisoning or local file inclusion (LFI Link 2))
  8. Generally, this particular session value is set by the application. The application would - generally speaking - fetch from a database that is explicitly set to type INT (ie: it holds a numerical value - nothing that can harm the application if always treated as an integer). Nothing is wrong with escaping the session value per se, it's the reasoning behind it - there is no reason to. Using "MRES because it's not MySQLi" isn't a fair argument to start escaping integers and treat them as strings because your application doesn't know the value - it does, and it's an integer. Also, I've seen a lot of people just wrapping values in MRES thinking it's their silver bullet; it's not.
  9. ... But let's address the real issues...     Short tags - no thanks Using a deprecated database api (mysql_*) - no thanks No reporting on failed requests - such line 52 (if($payment_status != "Completed") { /* ... */ } - good luck with player support on cash transactions (not everything will go smoothly 100% of the time - log everything you get from a 3rd party. (headers and post body - along with a timestamp - unless you hate yourself and want to make things difficult in the future)) Hard-coded property values - why make things harder for yourself? Collect this data from the database! Ew, hardcoded item names and pricing [*]Using mysql_real_escape_string() on integers for "security" - uh-huh, okay [*]You don't actually check a query is successful before you continue logic - you should definitely make sure the query is successful [*]Code is super messy - no thanks   Redo your script - don't use this in a professional production environment!
  10. ~Rob0t

    Slack Chat

    Hi community, I've created a Slack room for everyone, so feel free to join: https://mwgchat.herokuapp.com/ You will get a link sent to your e-mail address to the room and then you can chat. Hope to see loads of people there :)
  11. > your opinion is rather vague No, it really isn't vague. Vague would be "It doesn't work" > As for keeping consistent with an indent style I wouldn't be arsed XD if I was typing on a phone > [...] it makes code look neat [...] You have conflicting views. > I'm just defending a member who is doing me good so please respect his efforts Never did I say I didn't respect this efforts...   Ah, you took it as I was bashing you, I wasn't. I never said I didn't understand the "quick example on my phone" and "it's not a working script either, there are functions missing and it can be optimised" - I just dismissed them for the fact people would copy&paste this then complain it doesn't work.
  12.   All your properties have public scope by declaring them with var. You should read up on visibility You have a parse error on line 23 You have inconsistent indent style I think you meant to put your $log variable into a property so it can be read later. Also, it would be better to make this an array and format the results with implode You're assigning a lot of variables when you don't need to, albeit not a huge factor, it's bad practice. For example, line 35 can be in line 37.   Apart from that, nice.
  13. Depends on the purpose of this "menu"...
  14. Nice, but a couple things to improve on. You don't need 3 separate queries to get your stats, simply just do it all in one query - http://sqlfiddle.com/#!9/3df4b/1 select ( select count(id) from forum_ratings where postid = 1 and rating = 1) as thanks, ( select count(id) from forum_ratings where postid = 1 and rating = 2) as dislikes, ( select count(id) from forum_ratings where postid = 1 and rating = 3) as likes   --------------- You don't need to query and bring every column back (ie: SELECT *...) it's a waste of overhead. Select what you need. --------------- You have an } else { to print a blank string. Weird logic... --------------- You're not ending the headers to make the screen look nice. $h->endpage(); --------------- Perhaps make use of a switch() statement, instead of multiple if/else blocks. You don't need to put your query inside each if(){} block in the rating snippet. Don't Repeat Yourself.
×
×
  • Create New...