justsomeguy

Moderator
  • Content count

    29,852
  • Joined

  • Last visited

  • Days Won

    343

justsomeguy last won the day on June 19

justsomeguy had the most liked content!

Community Reputation

903 Excellent

3 Followers

About justsomeguy

  • Rank
    More Human Than Human
  • Birthday 06/03/1979

Previous Fields

  • Languages
    Focusing on PHP and JavaScript

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Gender
  • Location
    Phoenix

Recent Profile Visitors

263,655 profile views
  1. The browser shows that message because the content type is text/xml, although you have a syntax error on that header line. I would view the source code of the page and figure out what is actually getting sent, or just comment out that header so the browser displays it normally, and check what is being sent. Make sure you also have all error messages enabled and displayed or logged.
  2. As far as I know, those events will fire regardless of whether or not you're listening for them. The browser will still fire all of those events whenever they happen. It might take a little extra time to run your function, but if your function takes a really long time to run I bet the only thing that will happen is that the browser will end up firing that event less often. The majority of the time when that function runs it should be fairly quick though, it will just get the next position it's looking for, get the current time, see that they don't match, and end. That shouldn't take very long. It will take a little longer if the time matches, but if that happens you'll stop the video anyway.
  3. Set the playback rate and play the video, and use the timeupdate event to continually get the current time, then stop when it's where you want. Keep in mind that the timeupdate event probably doesn't fire for every millisecond or whatever, so instead of looking for a specific time you'll probably need to check if it's passed the next position.
  4. You can use the FileReader API to read a file on the local machine that someone picks with a file input: https://developer.mozilla.org/en-US/docs/Web/API/FileReader That sounds like the way to go. When you parse the text file you can build an ordered structure that you can search through to look for the next or previous timestamp.
  5. SQLStatement, adoCon, 3, and 3 are the parameters that are being sent to the open method. It is impossible to know what those are without figuring out what kind of object sco is and looking up the documentation for the open method to see what it expects.
  6. If you're going to ask the same question, then it's going to be the same answer: If you don't want to use PDO and have it throw exceptions when you make a mistake, then you need to check for errors yourself. If prepare returned false, then you need to print the error message from MySQL. You have a problem with the SQL query you're trying to prepare. You changed the format of that UPDATE query between the two pieces of code and now the query is wrong. UPDATE queries do not use the same format as INSERT queries.
  7. There are several problems with that upload code. The major one is that you are doing no error checking or validation on the file that was uploaded. If someone uses that form to upload a .php file, you'll just copy it to your server where someone can then access the URL, and now you're running some random PHP code that someone uploaded. That's probably the single easiest way to get your server hacked. You need to validate the file to make sure that it's allowed, and you also need to check for errors that may have happened during the upload: http://php.net/manual/en/features.file-upload.errors.php You also need to use prepared statements when you're sending data to the database. Don't put variables right into the query, use a prepared statement with placeholders that you can use to send the data separately to protect your database. The mysqli extension supports prepared statements: http://php.net/manual/en/mysqli.quickstart.prepared-statements.php To avoid re-submitting the form when someone refreshes the browser, after you finish processing the form you should send a location header to redirect the user. Then if they refresh they will only refresh the redirected URL instead of the form submission. You can redirect them to a thank you page, some other page that shows a message from the form, back to the form, etc. You should also move all of your form processing code to the top of your file, before any HTML output. If you're just going to end up redirecting the user there's no reason to send any HTML at all. The first thing the file should do is figure out if it needs to process or display the form, and go from there. For some reason you used an embed tag, you only need to use a video tag. Look up the video reference to see how to use that. You also messed up with the quotes in that string, if you view the source code of that page in the browser you'll see the problem.
  8. What happens when you run that code? There are several syntax errors, are you seeing those error messages? If not, they're probably going to an error log somewhere, maybe in the same directory as that file. The first step is to figure out how to see the error messages, all of those options are configured in php.ini.
  9. It looks like you use that tween function to move something, so figure out where you want to move it and use that function to do so.
  10. Like with any other animation, you make many small changes. With modern Javascript you would typically use requestAnimationFrame to handle the animation instead of the older setTimeout or setInterval.
  11. Take it one step at a time. Assuming you're just using Javascript for all of this, as long as the text file is on the same domain as the rest of the site you can load it by sending an ajax request for the file, then processing the response from the server. For each of the other things you want to do, look into the video element to see which events you can use and some of the properties and methods. For example, to change the playback speed: https://www.w3schools.com/tags/av_prop_playbackrate.asp Check here for the other properties, methods, and events that you can use: https://www.w3schools.com/tags/ref_av_dom.asp Just break things down into individual pieces that you can figure out how to do, and then put them together into your larger project.
  12. It's an empty array because it's not returning any rows, because your WHERE clause doesn't match anything. The result object shows that: Why do you think it's not supported, do you get an error message? One thing to point out is that you're saying the username and password are integers. Also, you really need to hash your passwords instead of storing them in plain text. PHP has a built-in password hashing library. http://php.net/manual/en/function.password-hash.php If you can, I would suggest sticking to PDO and prepared statements.
  13. There's a more correct way to do that. The table element has a rows property that contains a collection of all of the rows: https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement You can access the last row element and then use cloneNode to create a copy, and then appendChild to add it as a child of the tbody. https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode You can also use the DOM methods to create a new row and add cells to it: https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/insertRow
  14. Check that Wikipedia article, look at the EOCD table that lists the various offsets.
  15. If $sql is a boolean (true or false), then that probable means that your call to prepare failed. You should check if prepare worked before trying to run the other code. You should also make Id another placeholder in that prepared statement.