Jump to content

requinix

Administrators
  • Content Count

    11,338
  • Joined

  • Last visited

  • Days Won

    221

Everything posted by requinix

  1. You're missing that the escape sequence starts with a \033 (aka \e). And that's not a literal backslash, so if you add it into your $dictionary then you'll need to switch to double-quoted strings too.
  2. It's extremely unlikely that a Windows update broke this. Something else happened.
  3. Then your cloning is faulty. 1. If a chart "has a" set of series and categories, then a (deep) clone of the chart should also clone those sets. 2. A clone of a database entity should reset the object to a "new" state - ie, unset the key, mark the object as "new", and/or affect whatever else your abstraction library uses.
  4. Looking at that code, tell me precisely: what will happen if the browser POSTs data to the script?
  5. What does your problem have to do with VS Code? For that matter, what is the problem?
  6. Do a View Source of the page in your browser. Do you see PHP code? If so then Apache has not been set up properly to run .php files.
  7. Product ID obviously, description maybe, price maybe. Depends on your requirements.
  8. Basically. When you create a new product there'll be a record in the main products table, obviously, then according to the product type there will be... whatever additional work needs to happen. Like a record stored in another table somewhere. Yes.
  9. There is that risk, yes. But what I haven't said is that you're really the only one here who knows your application best. There is no one-size-fits all answer to stuff like ecommerce. No one can just tell you what to do and be totally right about it: every company needs something a little different, and when random people on the internet give advice some of it will be right and some of it will be wrong. I also don't think I mentioned but your questions are (mostly) not technical questions. They're business questions. Application requirements. So what you should do is figure out, as best as you can, what the requirements are and how to go about satisfying them. Is there a requirement that an order exist in the system before the user submitted payment? Is there a requirement that a cart be saved in an account instead of temporarily held in the browser? Create a specification that describes everything you need to support, then make sure what you code supports it.
  10. As long as you can park on it, it's good enough. Even if it has some cracks. Or isn't exactly even. Let it sit for a while, use it, and later you can decide what is wrong and what you need to do to fix it. Then next time when you need to pave a walkway you'll have a better idea of what to do.
  11. Yeah, there's a key. Products table has a type and key. Those two act as signals to your application('s code) telling it (a) the type of product and (b) where whatever other information the application needs is stored.
  12. The best way to learn something is to do it, even if it turns out to be a little bit wrong. As long as it's not too wrong, it's good enough to last a while. You can always change things later.
  13. Not that complicated. You store the main "product" information like normal, and if the product needs anything extra then you can store a product "type" and use that to know what/when other tables are relevant.
  14. Yeah. Sounds good. Sounds good. Sounds good.
  15. "subject" isn't something special... unless it's special to reCAPTCHA which I wouldn't expect. What's the code for the entire page?
  16. No, you can't just copy and paste stuff from the internet and expect it to work. Now would be a good time to start learning some Javascript. It's actually pretty easy to pick up - you can avoid most of the tricky and confusing stuff for a long time. data-callback="onSubmit" When reCAPTCHA completes it will (try to) call whatever function you name there. Pick a descriptive name, but one that isn't so generic that there might be another function on your site with the same name. If you're using jQuery, $('#form-contact').submit(function (event) { "form-contact" is the ID of your form. This sets up a function (aka "callback" or "handler") that will run when the form tries to submit. event.preventDefault(); That stops the form so that it doesn't try to submit. Don't want that yet. grecaptcha.reset(); grecaptcha.execute(); That runs the reCAPTCHA validation process. }); The submit handler ends without doing anything else. When reCAPTCHA succeeds it will call the function you named earlier. function formSubmit(response) { "response" will be the validation token but you don't really need it. // submit the form which now includes a g-recaptcha-response input Here is where you try to submit the form. That's not the full thing you need - not only does it need a couple things changed here and there, it needs to be rewritten a bit to do what it needs to do. Here's an actual template for you to use, again assuming that you are using jQuery: // anonymous function lets us use private variables (function() { // remember the form var $form = $("#the id of the form"); // whether we want to really submit the form or to trigger recaptcha var really = false; // when the form is submitted, $form.on("submit", function(e) { // if we're really submitting then don't do anything if (really) { return; } // don't submit e.preventDefault(); // start recaptcha grecaptcha.reset(); grecaptcha.execute(); }); // set up a "recaptchaSubmit" function for recaptcha to call when it completes window.recaptchaSubmit = function(token) { // from here on we should really submit the form really = true; // trigger a second submit $form.submit(); }; })(); There are two things in there you have to pay attention to: the ID of the form (you have to change that to match your <form>) and the reCAPTCHA callback here is called "recaptchaSubmit" (you can change that name if you wish).
  17. Oh, so that's all good then. Use phpinfo() to double-check that the Xdebug settings are what they should be. Otherwise... well, I've never once been able to get Xdebug working the first time, there's always been one little thing I've missed... with that said, the settings do look right...
  18. You could, if you wanted to make it persistent. "Saved cart" sort of thing. Most of the time a temporary cart is fine so sites store the cart in the session. It's unlikely that you could wait to put anything in the database until the very end. More likely is that you will eventually need to store the order in a "pending" state, to be confirmed later when the payment goes through or something. That depends on when you want to empty the cart. Typically the cart remains a cart until near the end of the checkout process when it becomes a pending order; that way if the user quits their cart is still intact, they can re-checkout, and you don't have extra unused information floating in the database. On that note, something to keep in mind is how the system should behave if the user aborts in the middle of the process.
  19. So it does not connect? So it does connect? First step is making sure the laptop can connect to itself. Then, when that's working, you try to get the VM to connect. Is it possible there's some VirtualBox settings required to make outbound connections? If you can browse the site from the laptop then at least inbound works. I was looking for, in other words, ^ that.
  20. It's listening for both IPv4 and IPv6. Which is fine. Try to telnet to the laptop from the laptop. The URL of the (virtual) site is 192.168.something, right? Not localhost or some other subnet?
  21. There are four steps here: 1. Make reCAPTCHA not validate automatically on form submission 2. Use your own form submit handler to manually start the validation 3. Give reCAPTCHA a callback to use when it completes validation 4. Use that callback to actually submit the form for real The first step is dealt with by data attributes, apparently. Look at the Javascript to see how it was used to satisfy the other three steps.
  22. Some Googling (coincidentally) turns up this, where the main answers show how to trigger the reCAPTCHA validation process manually.
  23. If it's "waiting for connection" then PHP isn't connecting. From inside the virtual machine, try using telnet to connect back to the host (with Netbeans waiting for the connection): $ telnet 192.168.56.1 9000 You might have to install telnet first. If it connects then your Xdebug settings are off in a way I don't see. If not then there's something preventing the connection - possibly firewall settings.
  24. Not even remotely the case. Locally, were you using the built-in server that PHP provides? Don't. It's good for quick stuff but it's not a real server. Set up your development environment to match your production environment as closely as possible.
  25. Yes, with one exception: currently all versions MariaDB claim to be MySQL v5.5, which can cause problems. Stick with MySQL, but if you really just cannot get over your paranoia then I would recommend Percona over MariaDB. Probably. If you were starting from scratch then I would actually suggest PostgreSQL instead, but if you need the MySQL family then I would say you should just stay with the original version.
×
×
  • 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.