Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Everything posted by justsomeguy

  1. Use the console object and its methods to send whatever data you want to the developer console. You can also use the browser's developer tools to set breakpoints in your Javascript code.
  2. You need to echo all of the HTML tags, right now the text you see there is the entire document. So before you output those messages, you want to print the doctype, html tag, head tag maybe with a style block, body tag, maybe you want to wrap the messages in a div or span and put a class on it, etc. Just like you're writing regular HTML. You just use PHP to echo the HTML instead of just writing it in the file. You can also close the PHP tag and just start writing HTML like at the bottom of the code.
  3. Your PHP code should produce a valid HTML document, so you'd use the same principles that you do with any other HTML document.
  4. Which columns are selected inside the exists subquery is totally irrelevant, they aren't even used. I always do SELECT * for those. The only thing that matters is if a row was returned at all, the number or values of columns aren't even considered.
  5. I haven't done all of the research on this, I just know it's out there. It's for you to do the research and decide if you want to use it to meet your own needs.
  6. Use CSS, set the font size using relative units like points instead of absolute units like pixels.
  7. Does YouTube offer a way to download the video?
  8. Are you talking about the size of the popup window?
  9. How unique it is depends on what you've done to your computer. https://panopticlick.eff.org Using that, my browser happens to be unique among the ~300,000 or so they've tested. A browser would not be unique if someone was using the default installation of IE/Edge on the most popular version of Windows. They probably see a lot of those. If any options which control web behavior are changed, or plugins are installed, or a bunch of fonts are installed, or any number of other things, it gets more and more unique. No, uniqid is supposed to be guaranteed to be unique (or, at least, it will take a long, long time before you get a collision). The total number of values possible for uniqid is greater than the total number of possible browser configurations.
  10. justsomeguy

    Remove data

    Yeah, it is. You want to build a house. But you really only like electrical, you're not really into framing and pouring concrete and plumbing and whatever else, that doesn't appeal to you. So you just toss up some boards so you can do your wiring and electrical, and you're wondering why the roof keeps falling and you have no running water. You don't want to actually learn how to frame the house, you just want someone to tell you how to keep the roof up. It doesn't really work like that. That's because you don't understand why and how the code works. There is not a single person alive creating functional programs by themselves who does not understand why and how the code works. You're trying to be the first. It's not working out.
  11. You could use localStorage in Javascript to track people, or there are other client-side methods to do the same thing. Look into browser fingerprinting. There is a lot of information exposed by the browser through Javascript which can be used to uniquely identify a particular computer. That's one of the ways that something like Google Analytics would use to distinguish individual visits.
  12. You do. It's common to have one or more files that every other file will include, files that do things like set up a database connection, define variables or functions that might be used on any page, and start the session.
  13. justsomeguy

    Remove data

    You're literally not telling the code to do anything. The code is "working" perfectly, it's doing exactly what you told it to do. You just didn't tell it to do much other than define a function. Well, you need to understand functions, so pick up your book and read the chapter about functions. If there are chapters before that one that you haven't read, then read those first. If you pick up a novel and the first thing you read is chapter 9, then you peruse chapter 17, then read the last chapter, then watch a video of someone talking about what they thought of it, you may be able to have a shallow discussion about the book but you're not really going to understand what it's about. This is no different. You have no concept of the very basics of the language that you're trying to use and it should be blatantly obvious with how much time you've spent and how little you understand that your methods of learning are completely ineffectual. You need to start at the beginning of the book and go from there. If you finish a chapter and you don't really understand what you just read, read it again. Repeat until you understand.
  14. It's just an old way to do it, the more modern way is to use addEventListener to attach handlers: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener The tutorial shows using event attributes because it's the easiest to understand. In the case of using a load handler on the body, the common alternative is to just move the code that you would want to run after the body loads to the end of the body instead of using a load handler.
  15. justsomeguy

    Remove data

    It's doing exactly what you're telling it to do. You include a file, then start the session, then define a function. That's all you have it doing. Perhaps next you want to actually run the function instead of only defining it. Even if you did, the page would still be blank because you're not telling it to do anything that would write anything to the page. So, it's doing exactly what you're telling it to do. It's not going to read your mind and determine what you want to happen and do that, it's going to do exactly what you tell it to. It's your job to figure out how to tell it to do what you want it to do. If you want it to print something on the page, then tell it to do that.
  16. justsomeguy

    Remove data

    I really doubt you need Yet Another Video to tell you how to do this: DELETE FROM table WHERE field = 'value' Or, a soft delete: UPDATE table SET deleted = 1 WHERE field = 'value' It's just not a complex thing to do. Are you really still not sure how to delete something from the database? Are you still stuck on that? If you have questions about your code, you need to post your current code and the questions you have.
  17. The error sounds like an issue with your web server, it sounds like it's not configured correctly to run whatever you're trying to run.
  18. Open your browser's developer tools and look at the Network tab to see the requests. Unless you're using a web browser to just open a local file (e.g. File -> Open), then you're using a web server.
  19. Restoring typically means replacing the database with a backup or original version.
  20. Give the table an alias each time and use that to refer to the different fields so that things aren't ambiguous. e.g.: left join drivers AS d1 ON schedule.dropOffID = d1.driverID left join drivers AS d2 ON schedule.pickUpID = d2.driverID Use the same aliases in the select list to make sure you're selecting the correct columns.
  21. What's the error message from the query?
  22. I don't know what express.static is, but if the device already has a web server you don't want to run another one. If the file is in the same directory then just write the filename in the HTML.
  23. justsomeguy

    Remove data

    If you want to do a soft delete then add a field to the database to say whether it is deleted, and change that to true when you delete something rather than actually deleting it. When you get data from the database only get rows where the deleted field is false. You can also store a timestamp of when it was deleted and run a script occasionally to delete records that are old enough. I've never heard of people doing a delayed delete, but a soft delete is common.
  24. Test each input you get and put any non-empty inputs into an array. Then you can sum the array elements and divide by the array length.
  25. justsomeguy

    Remove data

    That's right, none of the examples show something like that. How it got there, I'm not sure.
×
×
  • Create New...