-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
FileZilla Pro 3.55.1 Keyboard short key
requinix replied to LeonLatex's topic in Editor Help (PhpStorm, VS Code, etc)
https://www.google.com/search?q=filezilla+keyboard+shortcuts- 1 reply
-
- 1
-
Error with an old Wordpress Template upgrade to PHP 8
requinix replied to Kargano's topic in Third Party Scripts
#2 /****/****.com/rebuild.****.com/wp-content/themes/oldtheme/library/widgets.php(255): register_widget('VMenuWidget') That code seems to be incorrect because VMenuWidget does not have a __construct which the WordPress documentation says it needs to have. See if there's an update to whatever theme to be compatible with recent WP versions. -
Error with an old Wordpress Template upgrade to PHP 8
requinix replied to Kargano's topic in Third Party Scripts
What version of WordPress are you using? Is it at least 5.6, which is when they added support for PHP 8? -
Error with an old Wordpress Template upgrade to PHP 8
requinix replied to Kargano's topic in Third Party Scripts
The error is that some code is calling a function with the wrong number of arguments. The two function calls in the code you think seem to be correct. There should have been an exact filename and line number in the error for the calling code. That will tell you where to look. Then check what function(s) it's trying to call and why it's doing so incorrectly. -
The Item class should be responsible solely for the logic of an item. It should not have anything to do with determining what webpage was accessed, nor should it do anything with creating HTML markup. Those are responsibilities for other code.
-
That ^ was a hint.
-
Kinda sounds like you're saying that this if check would go in the Item class. That is not the case, right? You're talking about putting the code in some other file, right?
-
PHP - Database Searchfunction doesn't work as intented
requinix replied to KN1V3S's topic in PHP Coding Help
Compare this if(ISSET($_POST['search'])){ $valueToSearch = $_POST['suchfilter']; with this <form> If you're still unsure, try describing to yourself precisely how a <form> submits its data to the server. -
Virtually every editor out there can support PHP and SQL files. However, defining "support" is a trickier question, as it can be anything from highlighting to syntax checking to autocomplete, and different people want different options in their editor.
-
That's the code for printDiv but obviously Javascript doesn't think you've defined it. Which could mean anything from that code living in a completely irrelevant file to that function being defined inside of some other code that hasn't run and/or runs in a different context than the window. Hard to say which without knowing more.
-
wordpress Show only if user-role is subscriber AND site visitor
requinix replied to heathcliff's topic in PHP Coding Help
array_intersect will tell you the items that were present in both arrays. All you're doing now is ensuring that the array it returns is not empty - it has at least one of the two roles. If you want to require both roles then you can (a) use array_diff or (b) continue with array_intersect but count the number of shared roles it found. -
Then what are you "updating"? Also, number_format($values["product_quantity"] * $values["product_price"], 2) don't do that. I know you think you won't deal with figures above 1000 but number_format will add commas ("1,000") which PHP will not be able to reverse into a regular number. If you want to show a formatted number then go ahead and do that, but the value itself has to be unformatted. Which brings us back to the "what are you updating" question.
-
Tip: if PHP is complaining about a specific line in a specific file where you are calling count() incorrectly then you should probably post that specific file with its specific line. As well as everything that's between it and this get() where you believe the problem is.
-
Next time, please post all of your code intact instead of extracting the pieces you think are relevant. That said, with some educated guesses to fill in the blanks, If your HTML form is including lots of rows to update, you can't give every "product name" field the same "prod_name" field. It's like you wrote code $prod_name = "First product"; $prod_name = "Second product"; $prod_name = "Third product"; Think about it: what's $prod_name going to be? Use [ ]s in your form field names to create arrays, similar to the code $prod_name[] = "First product"; $prod_name[] = "Second product"; $prod_name[] = "Third product"; In this case, I would suggest using the product_ids (is it just one ID, right?) as one array key, then "product_name" and such as secondary array keys. Means you can remove the hidden prod_id field too. '<td><input type="text" class="form-control" readonly name="products['.$values["product_ids"].'][prod_name]" value="'.$values["product_name"].'" /></td>' But... the fields are readonly?
-
Help whit what its caled in the PHP envirinment when you call up
requinix replied to LeonLatex's topic in PHP Coding Help
It's not exactly easy to tell what it is you're describing, but I think the general term you're looking for is "front controller": where most/all code doesn't start off by executing individual .php files but instead everything goes through one file (typically index.php) which then has some amount of logic to determine what code should be running. That process can start with URL rewriting (telling the web server that everything should go through index.php) or simply using specially-crafted URLs (such as query strings like /my_directory/?stuff or PATH_INFOs like /index.php/stuff); the former is the modern approach. -
I don't see anything in the W3 reference for heights. Have you considered writing (gasp) your own CSS instead?
-
You can set height with CSS just fine. What markup/CSS do you have now?
-
That is a problem. Do not ignore the problem. Find out why it is taking so long and fix it.
-
Add event to an element created with javascript
requinix replied to raduenea's topic in Javascript Help
Where are you using table_body? -
The password_* functions handle everything for you.
-
You would be trading a negligible amount of resources to run your script unnecessarily for a lot less complexity. What's worth more to you: having to juggle cronjobs according to when you need them and when you don't, or always running some script that has a couple lines of logic that detect whether it needs to run? Also consider that this "always schedule and stop running if unnecessary" is extremely common. It's so much easier and there is virtually no downside at all to having it in there. Trying to manage the cronjob is a micro-optimization that comes with a lot of complexity. How long have you already spent trying to solve this problem? How much more time would it take to implement and troubleshoot it? It's just not worth your time.
-
It's only hourly. That's nothing. Your alternative of dynamically creating cronjobs is... weird, like, it feels really weird. Cron isn't designed for one-off tasks like that. I'm not even sure why you (think you) need cron for this in the first place.
-
Create one cronjob (manually) that decides whether or not it needs to execute.
-
For anybody else who wanted to know what the answer was, 1. Form has to indicate what the sid was so that the page receiving the new file contents knows which file it has to update. Do not give the src_name. That is not secure. sid is the way. 2. Write code that uses $_POST to get sid and new file contents, file_put_contents with the appropriate filename, ???, profit. Separately: loops are used when there are multiple things to work with. That query does not give multiple things to work with. There should not be a loop.
-
Shared server: Seeing Other Users Logged In
requinix replied to ChenXiu's topic in Apache HTTP Server
It's called a "shared server" because you share it with other people.