-
Posts
15,232 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
How to redirect this links to the specific page?
requinix replied to mahenda's topic in PHP Coding Help
You have to put something in your query so that you can tell where each result is coming from. Then use that to output the correct link. -
PHP 7.4 on Ubuntu 20.04
requinix replied to StevenOliver's topic in PHP Installation and Configuration
Yeah. Firewall off everything you can as strictly as you can, and use non-standard ports for private services like SSH.- 5 replies
-
- php 7.4
- ubuntu 20.04
-
(and 1 more)
Tagged with:
-
Redirect "non-www" to "www" still not working
requinix replied to StevenOliver's topic in Apache HTTP Server
Perhaps you would like to be so much like an AI bot it's funny. me made your day? -
Redirect "non-www" to "www" still not working
requinix replied to StevenOliver's topic in Apache HTTP Server
That's pretty much exactly what I said you needed to do, so... -
Redirect "non-www" to "www" still not working
requinix replied to StevenOliver's topic in Apache HTTP Server
Pick the one that looks most reputable and looks like what I'm about to describe, try it again, and if that still doesn't work then post exactly what you did. There should only be one redirect: if the URL isn't www or it isn't HTTPS then redirect to the HTTPS+www URL. We use them for the certificate but handle the server configuration ourselves. -
Redirect "non-www" to "www" still not working
requinix replied to StevenOliver's topic in Apache HTTP Server
If you can't get it to work then that means you tried something. What did you try and what happened when you tested to see if it worked? -
The term you are looking for is "AJAX".
-
mod_xsendfile is not bundled with Apache, that is correct. You have to go download it.
-
If you are running Apache then you can install Apache modules.
-
I need some help with shelling this site in the php shell.
requinix replied to jordanlg40's topic in Apache HTTP Server
To be clear here, what do you mean by "shell the site"? -
Changing array keys using another array
requinix replied to NotionCommotion's topic in PHP Coding Help
Hmm. Apparently I misread the desired output and totally didn't see the whole "split by underscore" bit. That adds a little more difficulty than I had accounted for. The one-liner was array_merge_recursive( array_fill_keys($keys, []), // initialize to key => [] ...array_map( // flatten outer values array $values => array_combine($keys, $values), // inner values arrays get keyed $arrayValues ) ) Dealing with the keys too will be getting more complicated than I would like to see in a single statement. -
Changing array keys using another array
requinix replied to NotionCommotion's topic in PHP Coding Help
Hint #2: I gave you the function calls in order, so array_fill_keys to get one array, array_map with a simple callback that uses array_combine, and finally array_merge_recursive with both results. Hint #3a: array_fill_keys starts off your output array with no data, array_map processes your data array, array_combine does the most logical thing it can do under those circumstances. Hint #3b: If array_merge_recursive tries to merge an array and a string, it'll add the string into the array. -
Changing array keys using another array
requinix replied to NotionCommotion's topic in PHP Coding Help
Want a hint? It's a pretty big one. array_fill_keys + array_map with array_combine + array_merge_recursive One-liner. -
-
It's an online store? Online? Why should it ever be closed?
-
Finding Matching Strings within 2 Arrays (having different [keys])
requinix replied to x1705's topic in PHP Coding Help
What? What output are you trying to get for that, and what process did you (you, personally) follow to get the answer? -
Let me know when you did it and what the result was.
-
$total_rows. Or create a new variable just for the folder's rows. foreach($folders as $folder) { $search_mailbox = $link->prepare("SELECT * FROM $folder WHERE from_email LIKE ? OR subject LIKE ? OR message LIKE ? ORDER BY received_date DESC LIMIT $offset, $limit"); $search_mailbox->execute([$searchemail, $searchsubject, $searchmessage]); $folder_rows = 0; if ($search_mailbox->rowCount() > 0) { foreach($search_mailbox->fetchAll() as $k => $row) { $email_number = $row['id']; $search_from = $row['from_email']; $search_subject = $row['subject']; $total_rows++; $folder_rows++; echo $search_subject . '.........................' . $folder_rows . ' / ' . $total_rows; echo "<br>"; } } } You should see $folder_rows stay between 1-50.
-
Then your code must not be the same as what you originally posted. Because what you showed there very clearly did 50 per folder. You also had a couple echo statements in it. One included the value of $total_rows. Are you saying you get more than 50 because the value outputted goes beyond 50? Because you do not reset that value for each folder. Reset the value to 0 before each folder's query, then see what output you get.
-
First, I need some confirmation: are you getting more than 50 per folder? Or up to 50 per folder and more than 50 total per page?
-
Ooh, you almost had me there. I didn't realize you were being sarcastic until I nearly hit the Submit Reply button. Great joke. 👍
-
LIMIT most definitely does work. But it only applies to one single query. If you want to limit multiple queries then you "have" to do that yourself. But what I said is still the best way to go. It will take some work to change to now, but it makes a great number of things much easier.
-
I don't see that code attempting to do a redirect. Please post the version you tried to make do the redirect since that is, after all, the one that doesn't work. When you do post it, please use the Code <> button so it doesn't end up as that blob.