-
Posts
15,274 -
Joined
-
Last visited
-
Days Won
432
Everything posted by requinix
-
Video player issue player dont work on every browser vbulletin 4
requinix replied to kerd's topic in PHP Coding Help
We're experts in programming, not experts in dealing with you. -
Video player issue player dont work on every browser vbulletin 4
requinix replied to kerd's topic in PHP Coding Help
If you're not even willing to attempt to troubleshoot this yourself - a problem, let me remind you, that only you can see - then you're going to have problems. We're not saying the solution is to use Chrome. We're saying the first step towards finding the solution is to see if Chrome gave you any useful error messages about why it has a problem. -
Video player issue player dont work on every browser vbulletin 4
requinix replied to kerd's topic in PHP Coding Help
You can't just claim that a .mp4 file is video/ogg. That's a lie. That said, you're also claiming that it's video/mp4, so as long as that is factually true (just because the file is .mp4 doesn't mean it is MPEG-4) then it should work is just about all browsers. All major browsers have an error console you can look at for hints as to why something is not working... -
Different types of returns using gethostbyaddr() and REMOTE_ADDR
requinix replied to ajetrumpet's topic in PHP Coding Help
You know how DNS can turn a name like forums.phpfreaks.com into an IP address like 199.119.180.53? And how if the DNS isn't setup then you can't get to the website? Similar thing for turning IP addresses into names. Sometimes they're configured, sometimes they're not. Nothing you can do about it. -
Problem with calling a method from within a method in another class
requinix replied to barraclm's topic in PHP Coding Help
Would be a lot easier if we could see the code for User.php. Please post it by using the Code <> button in the editor. -
Normalization problems can be corrected at any point - though the amount of effort required varies. But data problems can't be corrected retroactively.
-
It's a perfectly valid approach, sure. As long as you have the data in some form at all then you have what you need. Beyond that the only thing to gain is convenience. The chart stuff is non-trivial. Are you sure you want to make it yourself? Whatever you come up with won't be of the same quality that you can get with a third-party library.
-
Well you can't do much with them while they're still sitting in the database... I figure the "right" approach depends on what you have to provide to generate the chart. You probably need to end up with an array, naturally, but in what format? An array of key/value pairs? An array of arrays? Array of objects? What is the end result as far as the code is concerned?
-
I was insulting you? It is. No. What that does is fetch the next row in the resultset, which then updates $requiredItem. It's populating the array with the remaining rows from the resultset. Okay, let's say you don't know what mysqli_stmt_fetch does. In your while loop, you call the function: if it returns good then you put $requiredItem into the array, and if it returns bad then you stop. Clearly mysqli_stmt_fetch does something that moves you row by row through the resultset, right? Now look at the code before the loop. You call mysqli_stmt_fetch. We now know that moves through a single row. However, where your while loop did something with $requiredItem after every call to mysqli_stmt_fetch, before the loop you do not. Think about that.
-
That error very specifically means the thing on the left side of the minus is a string, and what's more, that the contents of the string aren't numeric. Are you sure $page is an int when that error happens? Could it be that you're getting the value from $_GET and the URL triggering the error has an invalid ?page= value?
-
No, you cannot have an array of just keys, because the very nature of a key is that it provides the location to a value. You also cannot have an array with just values, because no keys would mean you wouldn't know where a value was in the array. It was returned by that first useless call to mysqli_stmt_fetch.
-
How to check when a form field is left blank
requinix replied to SaranacLake's topic in PHP Coding Help
Of course not: you try to trim() every value in $_POST, and that's not going to work for values that are themselves arrays. You'll have to find an alternative to array_map + trim... It's impolite to require people to answer every question - especially personal questions. But there may be times when specific questions need an answer for the survey to be useful. Use your best judgment. Yeah, confused. If an answer is required then give an error if they didn't give an answer. If it is not required then don't give an error. -
How to check when a form field is left blank
requinix replied to SaranacLake's topic in PHP Coding Help
You already know the answer: -
How to handle json respond from api endpoint (Uncaught TypeError: )
requinix replied to charlion's topic in PHP Coding Help
The send method does not return a value. Forget XMLHttpRequest and learn about the magic that is fetch. -
Scraping a page should take maybe one second. Dealing with the database, a fraction of a second. All in all 40-50 pages should be, like, a minute. I can't believe that dealing with duplicates takes up 29 more. What's your code?
-
Yeah, no, multithreading isn't the answer. Concurrency is. Meaning you have this script that can do the crawling, and you run the script multiple times in parallel. But first, 30 minutes to get 40-50 results is absurd. Have you looked into why it's taking that long? It's ridiculous.
-
That may or may not be multithreading, depending on what you're trying to explain. But anyway, I was more interested in why someone said that you needed "multithreading". What is being slow and why is "multithreading" supposed to help?
-
Barebones PHP to add a contact email form upload file provision
requinix replied to boilermaker73's topic in PHP Coding Help
If you're having problems with a HTML form submitting to PHP code then we're going to have to see the HTML form and the PHP code. -
Best “navigatable” IDE
requinix replied to ajetrumpet's topic in Editor Help (PhpStorm, VS Code, etc)
Not really. Been many years since I've needed those kinds of docs. But the /docs/ stuff looks useless - the FAQ probably has everything you need. XAMPP comes with just about everything. Install it, maybe configure PHP for special extensions you need or whatever, then put your files wherever it is you're supposed to put your files ("Where should I place my web content?"). If you're on Windows, WAMP (er, I guess it's "WampServer" now) is also popular, and it may be easier to work with. -
Best “navigatable” IDE
requinix replied to ajetrumpet's topic in Editor Help (PhpStorm, VS Code, etc)
XAMPP is fine, sure. The point is that you're complaining about the hassle of having to upload files to some server somewhere every time you want to make a change. Well, you know what the easiest way to see changes is? If you don't have to move the files anywhere. Don't bring the files to the server. Bring the server to the files. -
Hold on. What?
-
Best “navigatable” IDE
requinix replied to ajetrumpet's topic in Editor Help (PhpStorm, VS Code, etc)
Have you really gotten this far and not set up a local development server for yourself? -
Is "gone" nullable? Meaning what, exactly?
-
array_shift($crawling); foreach($crawling as $site) { followLinks($site); } That part doesn't make sense. I get what you're trying to do, but the code doesn't match. You're using recursion which has three parts to it: 1. Start off with some value 2. Process one or more next values based on the current one 3. Stop at some point Per #1 you start off with a URL that is not in $crawling. By the time the first loop finishes, you have built up a list of URLs per #2. However you shift off something from $crawling - you intend for it to be the initial URL but it isn't in there. Additionally, when the second function call goes through its first loop, it's going to remove the first value from $crawling, however there's no guarantee that your current URL was the first one. What if the first function was on its second value in $crawling when it called itself? Basically every time you use a function like array_shift there should be a corresponding array_unshift (or $array[] = of course), and there isn't one for the initial URL. That miss leads into other design problems, and you're basically mixing a recursive crawler (function calls itself) with a non-recursive crawler (your use of $crawling). So before I go on, do you want to try the recursive approach (get URLs, get links, call function for each one) or the non-recursive queue (use an array to track URLs, read the next page from one end, add new pages to the other end) approach? Also, this is not object-oriented. Do you want to go that way or stick with the single function for now? Either way we're going to be getting rid of those global statements.