Jump to content

requinix

Administrators
  • Posts

    15,266
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by requinix

  1. Not that I know of. But are you sure you want something slick? Maybe something readable would have its advantages?
  2. To get a new number every day, seed the RNG with a number that stays the same all day long - say, the date in YYYYMMDD format - then request a random number. With the same seed you'll get the same sequence of numbers.
  3. SoapClient::__setSoapHeaders looks relevant.
  4. Is that what you want to do? Find out the "character" position for a match's byte position? You're only giving out small pieces of information at a time. It's hard to give advice on broader problems or situations when we have to work with is your use of mb_strlen and substr...
  5. Bytes and characters are not the same thing. You think it's characters, PHP is telling you bytes.
  6. $x = 70.889661; I don't understand this thread.
  7. I don't see any H2s with ids on the page. You can't link to one of them until they are given ids. Why do you not have a page dedicated to showing a single article? You should be linking to that, not to some anchor buried deep on a paginated page.
  8. Variables defined outside of functions are not available inside of functions. If you need $pdo then pass it as an argument like you're already doing for $id.
  9. I was actually trying to point out that you're attempting to solve your problem the wrong way. If you have an ID and want to make sure it exists then what you do is execute a query to see if there are rows matching that ID. You do not retrieve every single one. That's terribly, terribly inefficient. SELECT 1 FROM customer_details WHERE customer_id = ? Use that as a prepared statement and put your expected ID value into it as a parameter. Then execute and see if you got any rows back. But what's more, I'm skeptical you even need this at all. What are you going to do later on? You said redirect to yet another page? Why? Why can't you check that the row exists on that page? And you know, when you do that, your edit page is going to need to retrieve the records from customer_details too, and won't that look very, very much like the above query? So not only do you not need this page, you don't even need this query because your edit page will find out if the ID doesn't exist when it tries to load up the data it needs. Does that make sense?
  10. To make sure I'm understanding what's going on so far, You have an ID in $_GET. To see if that's a valid ID, you grab every single ID from the database and then check to see if the one you want is in there?
  11. More or less. What sorts of settings are you thinking about? Files are more suited for things that you don't really ever need to change, like the name of the website or its domain name, not to mention "obvious" configuration stuff like database information and credentials. What's "most practical" really depends on what you need to do, and how often...
  12. Modern search engines don't care as long as the URLs can uniquely identify the content they show.
  13. An SVG of that image would be very small...
  14. The question is do you want your entire website to be completely broken if you have a database issue? I mean, not even able to render an error page? Basic configurations are typically done in files because they're far more reliable, not to mention easier to modify and faster to read. Is there a particular reason you'd like to do a database instead?
  15. The width and height of the canvas are different from the width and height of the canvas element. What you've done is resize the element, however it will remain at its default drawable dimensions of 300x150. If you want to resize the canvas itself then you need to update its .width and .height. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas
  16. One of many. Lots of resources out there because different things work better for different people.
  17. There is no "should" here. It's like asking whether you "should" swing a hammer with your left hand or your right hand: the majority of people will probably be using their right hand because that works for them, but as long as you're doing a good job of it, there's nothing that says you can't use your left. IMO, for the most part if you need a container (like for background styling or padding/margins or as a position:relative-ed parent) then you can probably use the <body> for it. That can be styled just as easily as a <div>. You need to specify what you need to specify. If you need a height then use a height. If you need a width then use a width. With CSS, remember one rule of thumb: less is more. Start with a minimal amount of CSS and only add when you need to correct or improve anything. The more CSS you add, the more complicated it gets, and the more likely your changes will be creating problems instead of solving them. What? Completely different things. The box model is a general description of how sizes and borders and margins and stuff work together. For instance, "if you specify a width then does that include the border?" Flexbox is a technique for layout, like grid display (newer than flexbox) or nested <div>s (older) or tables (much older). What gap? What connection? Percentages are fine if you want relative measurements. But learn a little bit about all the different units available - because there are a lot more than most people know, and many of those are more appropriate than percentages. Coming up with a responsive design that supports large desktops, small laptops, and mobile devices.
  18. Stop dealing with fractional measurements and relative percentages and switch to flex. https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox
  19. If you have problem getting your code to work then you should probably post that code. Because we'll be a lot more inclined to help if we can see what you have so far than if we had to try to do everything for you...
  20. Assist with... what? What code have you written? What about it is or is not working?
  21. Despite starting with the same letter, PHP and Python are two different languages. The #1 rule of Python is to get your code indentation correct. Yours is very much incorrect. Try fixing that.
  22. Have you tried adding that template you have for the comments into the page you already have that shows the post?
  23. But why? If my billing and shipping addresses are the same then why do I have to type it in again?
  24. Does your code also say "función" and "definido" and "prueba/captura"? Post your actual code.
  25. Make sure you have error logging enabled everywhere - and, of course, are checking those logs. That includes making sure the command to run your Python script is putting its and stderr to someplace you can see.
×
×
  • 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.