Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. "Don't do a thing unless you have a good reason to do the thing" is all-around pretty reliable advice.
  2. That's not your full code. That's a series of screenshots of your editor showing one screenful after another of one particular file that has PHP code in it. I don't know why you thought that was an appropriate change because my educated guess is that the "txt_email" comes from a form and not a cookie. Then again, if educated guesses were enough to go on, these forums wouldn't serve much of a purpose. Stop using $_REQUEST and switch to $_GET (for query parameters) or $_POST (for submitted forms) or, yes, $_COOKIE (for cookies). Only one of those should ever be the correct source to use.
  3. PHP support for a 45-year-old protocol? Odds aren't good. If you can find some C code for it then you could translate that into PHP code. Or if you were really serious then you could instead write a PHP extension around it.
  4. array_diff will try to compare values like they were scalar values. For example, as strings. Thus the warnings about converting an array to a string. What you tried after that was throwing random code at the problem and hoping it would go away, which is inefficient and rarely ever works. If you want a simple comparison between the values then use array_udiff() with a function that does a simple comparison - such as by using the <=> operator. array_udiff($table, $newdata, fn($a, $b) => $a <=> $b)
  5. If you are getting the exact same error then you did not change the code correctly or completely.
  6. ...and? Take a look at your output: the MD5 hash on the left and the value of $element on the right. If you want to skip the md5-container then that would be when $element is...? For a more useful solution, if what you care about is when the filename is "md5-container" and not what directory it's in then use a function like basename to get just the filename portion of $element. But perhaps a smarter solution would be to not put your md5-container inside the directory you're trying to inspect. Don't have to skip over something if it's not there in the first place.
  7. Get rid of that iterator_to_array. It's useless at best and wasteful at worst. If you want to exclude something then you could write code to do so. Have you tried that yet? You could make use of one of the other existing iterators or simply look at $element directly.
  8. "Correlation does not imply causation." Looking through the source, it looks like the ones that support it are: RecursiveIteratorIterator, IteratorIterator, FilterIterator, RecursiveFilterIterator, CallbackFilterIterator, RecursiveCallbackFilerIterator, ParentIterator, not SeekableIterator, LimitIterator, CachingIterator, RecursiveCachingIterator, NoRewindIterator, AppendIterator, InfiniteIterator, RegexIterator, RecursiveRegexIterator, not EmptyIterator (duh), and not RecursiveTreeIterator. If there was a link then your quote of kicken's post would have included it...
  9. A lot of the iterator classes in PHP do some screwy things. This is apparently one of them: it implements (an internal version of) __call that sends method calls to the inner iterator. So you're getting magic behavior. Why does it do that? I don't know. It dates back to PHP 4 and I wouldn't be surprised if nobody has thought about it since then.
  10. Seeing the two table schemas and some examples of what data you have and what you want to get from it would nice.
  11. Threads from 2013 are not good places to ask for help. Even if they're on the same esoteric subject. Now that you have your own thread, try posting the code you have and a detailed description of what your problem is.
  12. You should find another tutorial: the code they've convinced you to use is... well, it's silly. It pointlessly uses encryption for something that doesn't need to use encryption. If you want a remember me cookie then all you need is to store a long random token in your database and associate it with the user - preferably in one-to-many form so the user can have multiple tokens for multiple devices. Store it in the browser with the Secure and HttpOnly flags. Then, every time the token is used to log someone in, you generate a new token and replace the old one.
  13. What code have you tried so far?
  14. hex2bin converts a hexadecimal string into a binary string. Is that what you want to do? Convert a hexadecimal string into a binary string?
  15. They're both correct. Compare the two. Can you see what's similar between them and what is not? Do you see a pattern to it? The difference is what properties are accessible.
  16. Stuff doesn't break randomly. If the certificate is the problem then your browser should be logging some errors about it. If not, something else probably changed, and the browser will probably have some errors about it.
  17. Book? Books take time to publish. That means they are never up to date with latest standards and practices, and trying to publish early is risky. Any reason you don't want to use any of the millions of online resources?
  18. https://www.google.com/search?q=eloquent+enable+query+log
  19. Look for a toSql() method, or Eloquent has a query log you can enable.
  20. let obj = o.target; if(obj.id==='added-line') { According to the docs,
  21. Most Linux PHPs get their information from the system's timezonedb, so all you have to do is update the system - which you'd need to do anyway.
  22. FTP doesn't do transfers like that. Use a temporary file like your code is already doing (but remember to delete it afterwards); get the temporary file name with tempnam.
  23. mail() is easy to use but not very good at what it tries to do. Consider using something like PHPMailer or Switft Mailer instead.
×
×
  • 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.