Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Unless you need something immediately, I would wait on your issue. Looks like the author is still active.
  2. File uploads do not go in $_POST. They go in $_FILES. https://www.php.net/manual/en/features.file-upload.post-method.php
  3. Kinda seems like the library is buggy. The code I linked to has a rather noticeable bug, and your var_dump() output shows it knows the data length but apparently can't get the data itself.
  4. Try using var_dump() instead of print_r(). That will show more specific information about each value, like whether something is a string and how long it is.
  5. Did you check if there were any errors reported by the library? Because I'm pretty sure I see a bug in it.
  6. Good thing about PHP is that it's open-source, so you can look at the library to see how it handles ETCO data. Bad news is that it's a bit perverse about the structure of the array. You specify a "timestampformat" key, and potentially "flags", but then everything else is more arrays. Those are where you add the "timestamp" and "typeid" values. $TagData['id3v2']['ETCO'] = [ "timestampformat" => 2, ["typeid" => 3, "timestamp" => 1000], ["typeid" => 4, "timestamp" => 1500], // etc ];
  7. What library are you using to write the tags? Does it actually use arrays with stuff like "timestamp" and "timestampformat"? Because that code sample you have there uses an associative array and thus will only allow a single timing code. If you're supposed to specify a "frame_name" and "data", which is basically the minimum, then the data would be the full frame data. Presumably raw bytes. So "\x02" (format) + "\x03\x00\x00\x03\xE8" (event 3, timestamp 0x000003E8ms) + additional timing codes.
  8. There's a lot of code involved in this form and email process that you aren't posting so it's going to be very hard to identify where the problem is. So generic answer: check the documentation for the form stuff to make sure you're using it correctly. Because "Array" means that the value was an array, but none of those values ought to be arrays.
  9. You could have. It's weird, you shouldn't really be adding system users to your personal group, but you could. PHP should run as an under-privileged user such as (I assume) "daemon". It should not run as your account. If you need it to be able to do certain things then you should be granting it permission. Here, I think I would change ownership on whatever directory to be owned by your user and the daemon group, then set permissions to 0775.
  10. At least one of those variables is a string containing an invalid number. Find it, figure out why it isn't the number you think it is, and fix it.
  11. Your user account is the owner and you've given yourself all the necessary permissions. But is PHP running as your user account?
  12. The first blob of code you posted was putting those results into an array and looks fine, but I can't help but notice that the request being made inside the loop is going to be the same every time. Shouldn't it be using $line somewhere?
  13. What's wrong with it? Describe your problem.
  14. style="background: url("https://safebuy.nz/images/background.png") center / cover repeat #EEEEEE;" Take a closer look at that.
  15. Post code.
  16. Every time you need a new format you'll have to modify your table schema. That's not a good thing. There is no exhaustive list of formats you can rely on, which means you are coming up with this list on your own and deciding "yeah, I think that's all of them". That's not a good thing. If there's 20 different media formats then you've got an ENUM with 20 different entries. That's not a good thing. It's the same problem as you had with the list of genres.
  17. Silly oversight on my part: if ($node instanceof DOMElement && $node->hasAttribute("href")) { should be if ($node instanceof DOMElement && $node->tagName == "a" && $node->hasAttribute("href")) {
  18. Given that there are better options for you to use, no, it is not okay.
  19. I think you missed the question. The referrer will be an absolute URL...
  20. PHP uses pkg-config. Make sure you've added your cURL libraries to it, or whatever process it takes I don't know. Then PHP should get the library from there.
  21. If you view a page at https://www.domain.com/page.html and it tries to show an image from https://www.domain.com/image/img.jpeg, what do you think the referrer string will be? Also, you cannot rely on the referrer string even being present. You should only block access if there is one.
  22. "For the sake of learning" is a good argument, but so is "use the right tool for the job". Learning about PHP includes knowing what it's good for and what it isn't good for. Surely there are other situations where you could apply PHP? Perhaps some scripting that isn't so straightforward? But if you really want to do this in PHP then there are things to consider, like - Make this a proper CLI script by taking arguments instead of prompting the user with questions - Don't use chdir to change directories and instead do whatever work needs to be done using relative paths - There's no need to call wget when PHP is perfectly capable of "copying" files from the internet - It can even extract ZIP files
  23. If you're looking for a suggestion, I would say to stop using PHP and switch to an actual bash script: there's nothing in there that needs PHP, and what's more, a lot of what it does is shell commands.
  24. https://3v4l.org/GH1pk If $buffer was what you say it was then it should all work fine. But it does not work fine. So $buffer must be something else. I know you think the contents of the file are that string, but have you checked literally what the value of $buffer is?
  25. That's great and all, but what is the value of $buffer?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.