Jump to content

requinix

Administrators
  • Posts

    15,062
  • Joined

  • Last visited

  • Days Won

    414

Everything posted by requinix

  1. I'm suspicious of your action.js. Please post the exact contents of that file. And you're sure there are no errors in your browser's console at all? So you load the page, open the console, and it says nothing?
  2. "Uncaught TypeError"? What is the uncaught TypeError it speaks of? There should be more to the message than just that...
  3. 1. IDs are unique. You cannot have more than one #from or #to on your page. Find some other means of identifying which inputs you want datepickers on. 2a. If you create a bunch of elements and some of them need to be hooked up with some Javascript stuff, (and you can't apply the Javascript stuff globally,) then hook up those new elements with the Javascript. 2b. When applying the datepicker, all you need is some jQuery collection - you can do whatever it takes to get a collection of the elements you want. 2c. There are multiple easy ways to have jQuery return you a set of elements somewhere specific and not across the entire document.
  4. Using those handlers is frowned upon in modern Javascript. For one, because it's not actually a binding process: you're literally assigning a function to that property, which means you can't assign a second one to it as well.
  5. If you're having a problem with an error then it's typically very helpful to others if you mention what that error is.
  6. Understand that this is a completely different problem than the one you asked for. Specifically, this is a great example of the X/Y problem: asking about your solution of "how to restrict window/tab sessions in PHP" as a means of accomplishing "we want to run some performance testing using multiple independent Chrome windows". Chrome is capable of running an instance (of the version installed on the computer) using a specific profile directory. It takes a little more setup since you need to create multiple profile directories, but that can be done mostly automatically with appropriate automation. If you're searching the internet for answers then look in the direction of automated UI testing: that universally involves scripting a browser to perform actions, which is what you want to do.
  7. Not Chrome. All incognito windows share the same session data.
  8. PHP can't tell the difference between one tab/window or another. The only option is to restrict all browsing such that the user never even leaves the page at all: by rewriting your site from the ground-up into a single-page application ("SPA"), meaning you're going to set aside a lot of PHP and do the majority of work in Javascript with frameworks like React. And by the way, this is a bad idea.
  9. Not sure how "I am using a database" means you can't use Google Maps? You can even use a custom "map" image, if you like the cartoonish style - people have done so with things like this GoT site.
  10. You need to have the code remember what the two colors are. The user picks one, but they have to pick another so you can't do a gradient yet (unless you have default colors), and the user picks the other. Each click of the button only tells you how to update a single color, which means you have to track what the other color is supposed to be yourself. But there is a fancy way of doing that: CSS variables. https://jsfiddle.net/jqrg7vcf/ The less mucking about with CSS rules you have to do, the better. Note that a gradient background of blue -> blue is the same as just a straight blue non-gradient background.
  11. VS Code and Netbeans can both be managed through apt, and PhpStorm is available as a snap and those naturally auto-update.
  12. If I change the max-width on the .trailMap, the markers reposition correctly for me. How are you trying to resize it? And instead of positioning elements over the image like that, consider using an older technique instead: the image map.
  13. Do you have any kind of PHP support at all? Autocomplete? Documentation? Popups? Been years since I used Eclipse... It wasn't like a regular text editor: you couldn't just open a file and have it work according to the language, you had to set up a PHP project to get PHP support. So unless that's changed, are you doing that? Honestly, though, Eclipse is a bit... dated, compared to what people use these days.
  14. Tell me you've never used any other programming languages without telling me that you've never used any other programming languages 🤣 https://docs.python.org/3/tutorial/floatingpoint.html https://www.codemag.com/article/1811041/JavaScript-Corner-Math-and-the-Pitfalls-of-Floating-Point-Numbers https://stackoverflow.com/questions/1661273/floating-point-arithmetic-not-producing-exact-results https://www.cprogramming.com/tutorial/floating_point/understanding_floating_point_representation.html https://stackoverflow.com/questions/753948/why-is-floating-point-arithmetic-in-c-sharp-imprecise and finally, https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
  15. I wasn't a fan of it for a long time either - things like "it makes diffs cleaner" just don't matter that much to me - but I slowly moved myself over into that camp over the last couple years. Mostly, I decided I kinda liked the consistency of all lines having those commas, rather than all lines except for the last one.
  16. A good portion of the programming community, quite possibly the majority, encourages trailing commas on multi-line statements in languages that support it.
  17. ...yes, in particular? I mean, you installed the PHP extension thing for Eclipse, right? Do you have any PHP support at all? Do you get other errors and/or warnings but not the one about unused variables?
  18. People still use Eclipse? What setup do you have to enable PHP support?
  19. And you need to do this over ftp? The only want to compare the contents of a file over FTP is to download the file and read it locally. If you have to do that, and if you're optimistic that the remote server's files are almost the same as your local files, then you might as well download all the files and do a normal local-local comparison. To do this in PHP, I would first recommend writing something that can compare files in two local directories. Because the complication here is going to be in the comparison work - not in the FTP work. For the FTP work, though, PHP already has built-in support for doing many file operations using the ftp:// stream wrapper and it might work for you. https://www.php.net/manual/en/wrappers.ftp.php If you have something that can compare two directories, then switching one of those two be "ftp://..." could work. If you're not aware of it already, I'll also throw out RecursiveDirectoryIterator as a hint. That lets you read files from a directory and also open files for reading. The "might" is because I don't know how the ftp:// wrapper handles connections: if it is able to reuse one (besides the PASVs) then that's great, but if it tries to create a new session every time you call something like file_get_contents then you should probably go with the regular ftp extension instead. So that's something for you to investigate: can you use RecursiveDirectoryIterator without it creating unnecessary connections?
  20. By understanding what the mysqli code you have now does, understanding how PDO works, and then translating between the two. It's like translating between two spoken languages (but considerably easier): you hear what someone says, you understand what they're saying, and then you repeat their thoughts using different words. $queryres=mysqli_query($myConnection,$querysl); $pagerow=mysqli_num_rows($queryres); $pagedata=mysqli_fetch_assoc($queryres); That runs a query, gets the number of rows it returned, and fetches the (first) row from the results. See what PDO offers to do that.
  21. That's JSON. Can I assume you've already json_decode-d it? Here's how to read that output: { The value you get back from json_decode represents an object. If you decoded it as an object (the default behavior) then you will have PHP objects to work with; if you told it to decode to associative arrays then the JSON objects will be PHP arrays. To get to the price, status, and name, first you have to get to "usedOffers": [ the usedOffers list. That means you need ->usedOffers or ["usedOffers"] on whatever variable you're using for the decoded JSON. The [ means this value will be an array. Since there are multiple items in this array, you need a foreach to get the next thing to work with. Each of those { will be an object (or associative array). The price is immediately available from there. For the condition status, you continue from there by getting "condition": { the condition, which is also an object (or associative array), and from that you can get the status. Similarly, the name is under the "seller" object. If you have trouble, post your code and describe both what you expected to happen as well as what actually happened.
  22. If you're on Ubuntu then do not edit INI files yourself. As most other major distros do too, Ubuntu will set everything up automatically for you. Undo all of your manual changes, including where you added that extension=openssl line, then install the php-openssl package (using apt).
  23. Where's the rest of it? The rest of the HTML and the rest of the CSS?
  24. Because as the first two words of that output show, those are warning messages - not exceptions. Which suggests that you didn't include in your own code the set_error_handler code that blog post demonstrated. Which, by the way, would throw an ErrorException and not an EngineException. And speaking of, there is no such thing as "EngineException". PHP 7+ converted some things into exceptions. Not all things.
×
×
  • 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.