Jump to content

requinix

Administrators
  • Posts

    15,259
  • Joined

  • Last visited

  • Days Won

    431

requinix last won the day on February 8

requinix had the most liked content!

About requinix

Profile Information

  • Gender
    Not Telling
  • Location
    America/Los_Angeles

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

requinix's Achievements

Prolific Member

Prolific Member (5/5)

1.2k

Reputation

379

Community Answers

  1. Something doesn't make sense here. Why can you look at IV values in the "current" element but for the pills/syrup you have to look "ahead"? I'm also not really following the algorithm. Given the example there, exactly what steps are you (as a human) following to get exactly what output?
  2. This post implies using their UsesServiceTrait to handle the mocking (well, faking of results) as seen in places like S3's MultipartUploaderTest.
  3. Don't? Just give it the whole document you're working with. When you did what, it did what with your what? It will make some alterations if necessary to make the document valid, which means if it's doing something then that likely means the source was somewhat incorrect HTML. Spend a bit of time getting familiar with DOM as a whole (not PHP's implementation, I mean the concept itself) and what it can do. With the sample you posted, I would expect an implementation that (1) finds H2 elements, (2) grabs their nextSiblings for the first paragraph, and (3) grabs their nextSiblings for the second paragraphs. It's also possible to do XPath queries for more advanced searching, but the new DOM API offers querySelector/querySelectorAll which is nearly as powerful. 🌎🧑‍🚀🔫🧑‍🚀 Always have been.
  4. You cannot run Javascript code inside your PHP code. It does not work and never will work. The only reason you saw "3072" before was because your PHP literally outputted that <script>, the Javascript executed in your browser, and what the code does is literally write the value to the page. The only way to get values like screen.width to PHP is through some sort of request to the server, such as AJAX. If that's not working for you then fix that and then you'll be able to use AJAX just like everyone else. But that's probably the wrong thing. Why does your PHP need to know the screen width?
  5. First step to manually parsing HTML is to stop manually parsing HTML. Use DOM instead.
  6. You've got three basic options for storage: a string, a number, or as binary A string is the obvious choice because human beings think of IP addresses as strings. You can support IPv4 and IPv6 easily because it's just a string. You can do exact searches because it's just a string, but CIDR-ranged searches are hard. A number is another choice, as an IP address is essentially a number. That's fine for IPv4 addresses, but the IPv6 is too large to support. Exact and CIDR searches are easy. There's also binary, which is probably the least convenient form to work with. It has the strengths of strings (variable-width) but its own disadvantages (binary data, inefficient ranged searches), as well as the strength of numbers (efficient storage) as well as their disadvantages (need to convert to/from string format). If you don't need ranged searches then use strings, if you think you need ranged searches then think again because you probably don't. Because this is one of those times where you can get lost overthinking the problem. Besides that, Don't store just the last IP address. Store all of them. Since you're dealing with user accounts you'll also have a session, and in there you can remember the IP address, and that means you can know if it changes (which would mostly mean a mobile device switching networks, but even that isn't especially common these days). Fun side effect of this is that you're more likely to think about session security, like how you should reauthenticate a user if a request comes from the "wrong" IP address...
  7. You need to add [the] path [to php.exe] to [the] "php.executables" setting. Open the VS Code settings, find "php.executable", and put the path to your php.exe in there.
  8. Less sarcastic answer is, Apparently the diff says that the two <aaaa> nodes are different, likely due to the attributes, so they can't be merged. What happens if they have the same attributes? Or is it that the diff somehow isn't being recursive?
  9. I like how you said "it works as it should", then you post the output of the diff which clearly shows what it's doing. So no problem, right? It's all working as it should, which means your expectations are incorrect. 👍
  10. Merging XML cannot happen in a generic way that will support everything. If you know the structure of the documents then the best thing will be to write code to merge the two together. The big question for that code is going to be how XMLDiff works. Have you seen what $diff looks like? Does that hold any clues as to what's happening when you try to "merge" it into the first document?
  11. Contact your hosting provider for assistance. In the meantime, you will need to upload your PHP file change by some other means, such as by using SFTP.
  12. You have something, somewhere in your code that is outputting an empty array. It's not in the code you've shown so far. Try searching your code for usages of json_encode that don't belong.
  13. PHP 5.2? Seriously? It's not simply a "recommendation" to update - you need to update. IIRC all of those extensions have additional DLL dependencies. Make sure you've grabbed those and installed them into a location PHP/IIS can find them.
  14. That is not var_dump output. What does this output: $stmt->execute(); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); var_dump($result); var_dump(json_encode($result));
  15. Then you're using the wrong username and/or password.
×
×
  • 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.