Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Do not put the gallery-id thing into your links. <a href="/client1/gallery/2019-holiday-party">
  2. Okay. But do you want to support other .php files? I will not ask a fourth time.
  3. Let me summarize what we covered in the first few posts: 1. The URL in the address bar is changing 2. [R] tells mod_rewrite that it should tell Apache that it should tell the browser to redirect to the new URL 3. You have a [R] in that rule I can't make it any more clear than that without actually giving away the answer.
  4. I don't understand how you could possibly be confused about what the URL is. Your browser seems to be remembering the redirect. Try an incognito/private window, or clear your cache.
  5. Depends on the answer to the "do you want to support other .php files" question I asked earlier.
  6. Yeah. When dealing with this stuff you need to think in terms of what you want the server to do, not the user experience. Because they aren't always the same. Do you want to support other .php files? Is a file. $ is end of input (end of the request URI). \? is a question mark. The purpose is to make sure that the request URI, which includes the query string, contains a .php at the end. Yes.
  7. I never said it was correct. I said your understanding of how the process works was correct - at least up to the part about redirecting. I then corrected you on how it works when you do and don't include the [R]. So you should now understand why what you have is not working the way you want, and what you need to do to fix it.
  8. Not this time 😁 This specific rule really is about removing the "menu.php". The other rule (which you haven't shown) is about adding it. Doesn't matter if you're hiding it, however... Right. You need something to add the extension back in. Apparently instead of the rule you posted, which tries to remove menu.php entirely. For adding extensions you need two rules: obviously the one to add the extension, but you should have another rule to remove it if someone tries to go to /menu.php because of SEO stuff. Here is the second one because it's a little more interesting. Try coming up with the first one yourself. RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_URI} \.php($|\?) RewriteRule (.*)\.php$ $1 [L,R=301]
  9. It's not bad. It just isn't what you want to do. At least in this thread. In your other thread, you do want the [R] on that menu.php rule because you want the user to see the /whatever/ URL. I assume. The rest of the stuff you said was right.
  10. Oh, yeah, sorry I kinda glossed over it: you're removing /menu.php entirely. Presumably you have menu.php as an index, or have set up another rewrite so that /whatever/ is mapped to /whatever/menu.php.
  11. Not quite. mod_rewrite will rewrite and "tell" Apache about the new one automatically. That's its whole point. Base functionality. You don't need [R] to do that. What [R] means is "figure out the new URL and send it to the client with a 3xx redirect".
  12. Right so far. So if [R] means redirect...
  13. Do you know what the [R] flag to RewriteRule means?
  14. You've written a rule that will turn /menu.php into /menu.php. People think of this stuff backwards. You are not removing the .php extension. You are adding it. As in you want someone to see /menu in their browser and have the server add the .php extension.
  15. Oh right, PHP allows iterating over members of an object... shudder There is a syntactical way though, which should just about never be used $data->data->{"185.220.101.46"}->appears
  16. I'm currently at work dealing with some stupid off-shore developers so I'm just going to cut to the chase here: $data = json_decode($json, true); echo $data['data']['185.220.101.46']['appears']; echo $data['data'][key($data['data'])]['appears']; foreach ($data['data'] as $ipaddress => $result) { echo "({$ipaddress}: {$result['appears']})"; }
  17. You are mixing object and array access together. It will never work. It will always be only object access or only array access. Because "185.220.101.46" is not (normally) a valid property name for an object, I suggest sticking with the array data from json_decode. Then use only array notation when trying to get the value.
  18. Don't presume. Check the documentation.
  19. You're way off. For one, it's not an object. In fact you explicitly told PHP that you did not want an object. So it gave you an array. If you want an object then do what Barand said. For two, you don't seem to have any idea how the data is structured. Maybe something will click if you look at indented print_r output? Array ( [data] => Array ( [185.220.101.46] => Array ( [domains_count] => 0 [domains_list] => [updated] => 2019-12-02 22:04:25 [spam_rate] => 1 [frequency] => 6827 [frequency_time_24h] => 106 [frequency_time_1h] => 2 [network_type] => hosting [in_antispam] => 1 [in_security] => 0 [appears] => 1 [country] => DE [submitted] => 2018-01-11 20:34:37 [frequency_time_10m] => 2 [sha256] => e39d4a9be2f210d1a75ba2b5ece08a4b35e99002b03aeb6ceaad1d98de87c248 ) ) )
  20. Another option besides passing the number is to make sure the file list is always sorted (however, just always sorted), then you can search for the filename in it to get the 'n' index.
  21. Put it into a hidden input with the rest of the form that I assume you're using. And you think that Javascript is? Spoiler: it isn't.
  22. Did you notice the link in my post? The one that goes to a page whose very first sentence is "Xdebug replaces PHP's var_dump() function for displaying variables"?
  23. I didn't say you were debugging. I said you're using Xdebug.
  24. Note to self: next time someone talks about var_dump output, ask them to post said output. Because that way it will be much easier to spot when... You are using Xdebug.
  25. I don't see anything in your code that has to do with file sizes. Are they all in the same directory? Using any subdirectories?
×
×
  • 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.