Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Instead of deciding on all the different sites that someone could be accessing, think about this in terms of whether or not they're accessing the site you want them to. It's much easier that way. Somewhat separately from that, RewriteRule matches on paths, not on hostnames or full URLs.
  2. Did you edit the correct file? The one mentioned by phpinfo? And you restarted? I don't think there are any DLL dependencies so that should be all you need to do...
  3. ...It's running. It's already running. You know it's running because you get the "it works" page. So what was this about trying to start it? If you're looking at Windows's services list, "Automatic" means that the service will run automatically on startup. Which is good, and means you don't have to run it yourself manually. You don't need to change that. (Suggestion: change that to Delayed, meaning it's a little lower priority, to help with better startup times.) If you have PHP basically working then mysqli is a matter of php.ini settings. Edit your php.ini (phpinfo will tell you exactly where that is), creating it if you don't have one yet, find the "extension=" area, and uncomment the extensions you want to use. Then restart Apache.
  4. Set the canonical URL as whatever page it is, so English and Spanish and German. Also make sure you're specifying the language. Then wait and see if GSC still thinks they're duplicates.
  5. It's better to paste the (relevant) code, and/or screenshots for stuff that's visual, directly into your post: most people here try to keep safe and so won't download random files from strangers on the internet. That stuff you included there is XML, and it's easy to read with PHP. But you're talking about margins and line breaks, which isn't actually PHP, though the line between what is and isn't PHP does get a little blurry sometimes. Can you give a more detailed description about what you're doing, what you've written so far, what happens when you run it, and what you were expecting it to do instead? Remembering to post code as you go, of course.
  6. An alternative to using HTML markup for the value would be to put it directly into the Javascript code. const END_TIMESTAMP_MS = <?= $whatever_end_time ?> * 1000; You need to consider the same sorts of things you would with putting values into HTML, in that you should make sure the value is safe - safe for Javascript, that is. (But since I'm assuming $whatever_end_time is a number, it's naturally safe without needing any escaping.) And tip: don't literally count down to the time, as in do things like "seconds--". Because you won't be able to get to-the-second accuracy with Javascript, and it will drift as it runs: for example, you'll find you did "seconds--" 60 times but it's actually been 61 seconds, and now the timer is off by a second. It may sound weird, but instead of counting down, recalculate how much time is left on every "tick". As in function update() { const remaining = END_TIMESTAMP_MS - Date.now(); if (remaining > 0) { // calculate hours/minutes/seconds and display } else { // count down complete } } The drift will still happen, and you'll notice that occasionally the timer will skip a second because of it, but (a) some drift is unavoidable and (b) it's probably more important that you provide an accurate timer than you provide a "smooth" count down.
  7. The server should be configured as: - en.mobirom.ro uses that /en/ directory as its root - the English URL paths do not have an "/en/" prefix, as in "/en/whatever/page.html" - they should be the same as the normal Romanian ones Doing a little checking on your site, that's not the case: the English site is also using the root directory, which means I have to go to en.mobirom.ro/en for it to work. After fixing the site to use /en/ as its root, and hopefully you can but if not then keep reading and we'll solve that problem separately, - The .htaccess for the Romanian site (/.htaccess) will only apply to mobirom.ro - The .htaccess for the English site (/en/.htaccess) should only apply to en.mobirom.ro, however: - Unless you tell Apache otherwise, mobirom.ro/en/whatever/page.html will work. This is bad for SEO and you should make sure the English site is only accessible at en.mobirom.ro. That will also mean the /en/.htaccess only gets used for the English site. - This thread is public to the internet. Please don't create debugging pages like you have now for /en/ unless you want anybody to be able to see them... Checking the REMOTE_ADDR to only allow you would solve this. So /.htaccess should look something like RewriteEngine on # # HTTP->HTTPS and WWW redirect # RewriteCond %{HTTPS} off RewriteRule ^ https://www.mobirom.ro%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !=www.mobirom.ro # you should not need these two... #RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ #RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ # you do not need this, Let's Encrypt will follow redirections # they also won't validate the SSL cert, so an expired or even self-signed cert will be okay #RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$ RewriteRule ^ https://www.mobirom.ro%{REQUEST_URI} [L,R=301] # # English site redirect # RewriteRule ^en/(.*) https://en.mobirom.ro/$1 [L,R=301] # # HTML pages # RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(2)\.html$ /mese/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(6)\.html$ /scaune-curbate/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(3)\.html$ /mese-bar/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(5)\.html$ /scaune-bar/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(4)\.html$ /tabureti/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(7)\.html$ /seturi-mese-si-scaune/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(15)\.html$ /mobilier-lemn-curbat/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(9)\.html$ /masute-cafea/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(11)\.html$ /scaune-balansoar/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(13)\.html$ /mobilier-terasa/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(1)\.html$ /scaune/$1_$2_$3.html [L,R=301] And /en/.htaccess will look similar: RewriteEngine on # # HTTP->HTTPS and WWW redirects # RewriteCond %{HTTPS} off RewriteRule ^ https://en.mobirom.ro%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !=en.mobirom.ro # you should not need these two #RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ #RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ # you do not need this, Let's Encrypt will follow redirections # they also won't validate the SSL cert, so an expired or even self-signed cert will be okay #RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$ RewriteRule ^ https://en.mobirom.ro%{REQUEST_URI} [L,R=301] # # HTML pages # RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(2)\.html$ /tables/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(6)\.html$ /bent-chairs/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(3)\.html$ /bar-tables/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(5)\.html$ /bar-chairs/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(4)\.html$ /stools/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(7)\.html$ /table-chair-sets/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(15)\.html$ /bent-wood-furniture/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(9)\.html$ /coffee-tables/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(11)\.html$ /rocking-chairs/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(13)\.html$ /outdoor-furniture/$1_$2_$3.html [L,R=301] RewriteRule ^([a-zA-Z0-9-]+)_(\d+)_(1)\.html$ /chairs/$1_$2_$3.html [L,R=301] Since your server looks properly configured for the two sites, you could actually use %{SERVER_NAME} in place of the hostnames, making some of this easier to copy and paste. One more thing: PHP 7.4 is really old so please upgrade if you can.
  8. What page are you talking about? Your PHP code suggests images hosted on the server, but looking around all I see are images hosted on that CDN.
  9. The message is "Could not connect to database" but I don't see that in the code you posted... So where is it coming from?
  10. .htaccess files are for people who can't modify server configuration. Can you? If you can then you should be putting stuff into the VirtualHost definitions - you'll get slightly better performance that way. And it would also solve your problem as you'd be putting the Romanian rules in the main site config and the English rules in the en subdomain site config.
  11. Yup. Which means it's not executing. Did you put this code into a file with a .php extension?
  12. You have code that is able to get their location. You need to take that location data and put it into the link at that time - you can't put it in there ahead of time. Take a look at MDN's geolocation examples for something that's actually very close to what you want to do.
  13. PHP cannot interact with the card reader. You'll need Javascript and/or some sort of client-side browser extension to read information from the card, then you can submit that data to PHP just like if it was a form that the user was filling out.
  14. You can flatten the first array with array_merge and the ... operator. That gives you an array of size 11 and will keep the same ordering. Then use array_combine to create a new array using one of them for keys and the other for the values... is what I assume you want.
  15. "Merge in order" how? What's the output you want to get? Spoiler: the answer is probably going to involve some combination of array_combine, array_slice, and/or array_merge.
  16. It's possible to do, but actually this is more like a demonstration of my point that you don't need it to make that work. But that's just a detail. The scrollbar thing is as described: go ahead and make the text go off the screen, then set overflow-x on a parent element to hide it. If that's not working then please go ahead and just post that link.
  17. What part of the page are you talking about? The "322GW" at the top? Yes, it isn't absolute positioning. It's simply a <body> with overflow-x and a descendant element (a heading inside a div inside a div inside a div...) whose text content is overflowing out the side. The positioning is done (using grid) by splitting the "row" in half, with the image on the left and the text on the right. The text's font size was chosen such that it's able to fit the text on the screen normally (the text is known to be a short string like "322GW" or "222"), and there appears to be a little bit of responsive design involved, but collapsing the page enough will eventually cause it to overflow.
  18. XHTML? No, this is just regular HTML... <header> elements are HTML 5 replacements to writing stuff like <div class="header">, which means things like browsers and screen readers can more accurately understand the nature of a page. That means they're geared towards content, not metadata. Which means they belong in the document body. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header
  19. Absolute positioning is a double-edged sword. It does make sense in a number of situations, and is even the "correct answer", but there are a number of other situations where it isn't a good idea and the design should be done through choices in layout instead. I'm not really sure what the goal is because making text go off the side of the screen seems weird, but I'll throw out something: have you considered using screen-relative measurement units (like vw/vh) with things besides the width? Like, you can apply it to font-size (but be careful about that), or margin-left.
  20. Nah, it's fine. As long as it's okay with you, "here is my site, please help me understand why it's not working" is totally a reasonable thing to do. Absolute positioning? Oh, that could be a problem. Really should avoid that whenever possible.
  21. If I modify the example to push "Design" off the right edge, I get the horizontal scrollbar. If I set overflow-x:hidden on the body, the scrollbar goes away. So that's working as expected. Can you add more to the example? Like these images (or placeholders of) and containers you're working with?
  22. Can you demo this somewhere like jsfiddle, if it's not already visible somewhere? You should be able to resize your browser to mobile proportions to trigger the effect, or if you're using... dated design practices, enable its "emulation mode" or whatever to simulate a mobile browser. The scrollbar will be not just because of content but because of bounding boxes: if you have content way off to the side, overflow-x can hide the content, but that won't matter if the element isn't bound by its width such that it actually has overflowing content.
  23. What we need to know is that. To be blunt, we can't help you solve a problem if you don't tell us what the problem is. I'm guessing that when you say "it is never sent", you mean "I always receive the 'there appears to be a problem with the form' message even when I fill out all the fields"? Three things: 1. Only one <form> can be submitted at a time 2. Only the fields inside of that <form> will be included in the submission 3. When you click a submit button, its parent <form> is the one that gets submitted - if there is one For the record, the actual rules are a little more complicated, but the above covers most situations. Including this one. Considering the above, it should make sense you don't get any data: the Submit button isn't in a form at all, but if it was, you've split the fields between multiple <form> elements. Form elements don't have any meaning when it comes to (visually) designing a page, so you can put them anywhere you want. Have one single <form> that covers the entire form, with all the fields and the submit button. Use it to "wrap" the entire application form.
×
×
  • 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.