Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Everything posted by justsomeguy

  1. justsomeguy

    Remove data

    If you go back and look at the syntax error, it's on the line where you throw the exception. You don't have any code to catch it. You need to focus on the line of code with the error. It's a really simple, basic error and you need to be able to spot it.
  2. justsomeguy

    Remove data

    That example isn't really necessary, it's just trying to describe what exceptions do and what they're for. You're missing the point. You have a syntax error in your code. I showed you the manual so you can see examples of using exceptions. I did not intend for you to just copy and paste one of the examples into your code. That's not the point. You need to identify and fix the syntax error in your code. The manual shows you how to correctly use exceptions. Look at that code, look at your code, and figure out what the syntax error is in your code. The point is to understand the code you're using, not just copy and paste anything I link you to.
  3. You would need to give the entire query an alias, and then you can join it with any other query, including itself. It seems like that would be inefficient though, the joined query won't have any indexes that will help speed things up.
  4. Use the same method to get all of the elements by class name and loop through them. For each element, instead of adding a click event you need to remove the active class, get the next sibling like the code above is doing, and set display to none.
  5. this refers to the scope of execution in Javascript. When you use it in an event attribute, it refers to the element that the event was triggered on. So using it in the onclick attribute and passing it to a function means that you're passing the button element that was clicked to the function. Scope and this in Javascript are fundamental to the language. Suggesting scope isn't useful indicates that you don't really understand how the language works.
  6. You can use the ::first-letter selector to target that. https://www.w3schools.com/cssref/sel_firstletter.asp If you want the first letter of each word to have that effect then you need to wrap each word with the element that you're targeting in CSS, like a span.
  7. justsomeguy

    Remove data

    Look at how those examples create exceptions to throw. Then look at how you're trying to create the exception.
  8. justsomeguy

    Remove data

    All of the examples on that page work. You need to look at those examples and look at your code and figure out the difference. The error message is telling you which line to look at.
  9. justsomeguy

    Remove data

    http://php.net/manual/en/language.exceptions.php
  10. Note that you will not want to keep that enabled all the time. For sites with decent traffic, that's going to eat a lot of disk space quickly.
  11. That's a pretty vague question, but you're probably looking for this: https://dev.mysql.com/doc/refman/5.7/en/audit-log-logging-control.html
  12. justsomeguy

    Remove data

    Yeah, it sure does. Look up exceptions in the PHP manual.
  13. justsomeguy

    Remove data

    Well, if you haven't fixed the syntax errors, then yeah there are still syntax errors. The code does not run at all if there are syntax errors. You need to fix those before doing anything else.
  14. If you're relying on the user-agent header, then yes that can be altered or removed completely. Any data that the user sends is prone to being altered. Unless you're passing a custom value to get_browser all it does is try to make sense of the user-agent header based on the information that it has. The user-agent header is supposed to contain information about the browser but, like most other headers, it can be changed or removed. It's not required for an HTTP request.
  15. justsomeguy

    Remove data

    You can't run anything with syntax errors, so start by fixing those. Count the number of parentheses if you're not sure, and look into exceptions. You're using syntax that PHP doesn't even use, like you're trying to mix Javascript syntax. Once you figure out the syntax issues, put this at the top of your PHP code: ini_set('display_errors', 1); error_reporting(E_ALL);
  16. justsomeguy

    Remove data

    That's correct, the code has syntax errors. You are also not executing the function, so even if the syntax errors were fixed it still wouldn't do anything because all that file does is require another file, then start the session, then define a function. You don't run the function.
  17. justsomeguy

    Remove data

    Whatever file you're going to run to do the delete needs the code in it to do the delete.
  18. justsomeguy

    Remove data

    The problem is your PHP code has syntax errors, it's not written correctly. Your deleteRecord function isn't correct, review it. You also are not actually running the function anywhere. If you don't know how to put a link on a page, then you need to start with the basic HTML tutorial. Even if you fixed the syntax error that you have there, those 3 lines of code aren't doing anything. You require a file, start the session, and then just write a variable name. Writing a variable name doesn't do anything. Also for some reason your deleteRecord function is in a different file. Shouldn't that function be defined in the file where you want to actually do the delete?
  19. justsomeguy

    Remove data

    I know, you've already said that. So, you don't have to figure out which user to delete because you already know what the ID is. You just have to tell the page that the action you're trying to perform is delete, that's all. You have all the other information the code needs to delete the current user. Yeah, make it a link. I thought you were doing this all on one page which is why you posted the image upload code in a thread about deleting a user, are you separating it into pages now?
  20. justsomeguy

    Remove data

    I don't know, I'm not going to watch the 20 minute video. Deleting is simple, you just tell the database which row or rows you want to delete using the WHERE clause. That's it, that's all there is to it. You already know which row you want to delete because the ID is in the session. So you don't even need to think about that. The only thing to think about is how to tell it you want to delete the user, and you can put a variable in the URL querystring to tell the code what you're trying to do. I don't know if it really takes 20 minutes to explain all that, I assume in that video you're picking which row to delete instead of already having that ID in the session. Also, instead of a ton of br tags on a page, use CSS to set things like margin, padding, height, etc. You could just put a top margin on that bottom image.
  21. If everything is the same type you can just select a scalar value: SELECT 'Vendor Contract' as `type`, item_code, desc, qty...
  22. People can't hide their IP, but multiple people might use the same IP. One person might also change their IP.
  23. justsomeguy

    Remove data

    The first thing you need to do is put your PHP code on the top of your file. Sending headers like session cookies or redirecting doesn't work if you already sent a bunch of HTML or other output. Assuming that load function actually redirects the user, that code is fine, not all of that was included in previous replies.
  24. PHP is popular, you can also use ASP.net, Python, Node, or several others.
  25. justsomeguy

    Remove data

    I am referring to the file you are working on changing.
×
×
  • Create New...