Jump to content

thescientist

Moderator
  • Posts

    8,682
  • Joined

  • Last visited

Everything posted by thescientist

  1. Are you using any sort of version control? Can you review the commit logs and find out if it was removed (likely by accident)?
  2. You're trying to INSERT against 5 columns in your database, yet you only supply one VALUE, and it's a json_encoded string of an array of associative arrays. As suggested by the error message, I would suggest you look up the syntax for an INSERT statement (i.e. read the manual). http://www.w3schools.com/sql/sql_insert.asp
  3. Just take it one step at a time. You've more or less been given the flow, so just try writing the steps out in psuedo-code first, i.e. Obtain value from GET parameter Make it all lowercase Get the first three or four characters Run it through a switch case etc Write out the steps of the program in very clear and specific steps and then start working from there. Validate EACH step before moving in. So don't go to step 3 unless you are correctly getting your GET data and it is indeed all lower case. Use echo or print statements to debug your code and make sure the values of things are exactly what they are supposed to be.
  4. I'm not really understanding what's actually happening. Can you provide actual examples of it working and it not working? Having a hard time making a connection between $agree and your switch statement, combined with the requirement here Are you trying to do a string search? Or exact match? Does it need to be case sensitive? Also, you didn't include the error you get back when it doesn't work.
  5. Also provide the code your are using
  6. how are you testing this? Are you trying to do this locally? Or after uploading a change locally on your machine to your live server?
  7. Sounds like your count is off. Are you sure the number of parameters your binding matches the number of parameters you are preparing?
  8. There is a really good utility library (if you feel so inclined) called lodash that you may want to look into https://lodash.com/ it has a lot of useful object and array decorator functions, such as difference https://lodash.com/docs#difference or if you are using jquery, there seems to be a neat solution here using grep http://stackoverflow.com/questions/10927722/jquery-compare-2-arrays-return-difference
  9. I'm not sure where the f or the o that you are referring to are coming from.
  10. That's not possible with HTML. You may want to look into the Web Audio API though (Javascript solution) https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/
  11. Are you saying the source of your site itself still displays the old information? If so, are you sure you actually uploaded the new source?
  12. no. Look at his post. controls="controls" now look at yours "controls"
  13. @laurentiumarian please make your own thread / post, please don't just hijack another members question.
  14. Are you asking for how to develop HTML and PHP on a tablet device? https://onyx-boox.com/shop/onyx-boox-m96-universe-97-inch-e-ink-pearl-display-e-book-reader-google-play-ivona-text-speech-bluetooth-4-0-low-energy-powered-android-4-0-4/ Or how to develop for a tablet device?
  15. what have you tried? What specifically are you having trouble with? I curious though, because If that is indeed your original code, then surely it should be a trival change to change to alter the output text and add an else conditional. At the very least, present what you've tried, we're not going to do it for you. Also, please use code tags when posting code. At the very least, separate it from the body of your post.
  16. I would also suggest, since often beginners ask these kind of questions, is to start getting into unit testing. It is a good way to discipline yourself because it often exposes to developers how coupled and complicated their code is (because writing tests initially always seems very daunting and overwhelming). As you progress and start adhering to good OOP design principles, and start creating classes with interfaces that follow the Single Responsibility Principle, you will find that unit testing becomes very easy, which leads to greater confidence in your code. As Ingolme pointed out, when you do encounter logic errors (like an oversight or an edge case in your business logic) you can create a test for that and know that you won't add any regressions to the code that you currently have.
  17. It's still not clear to me what you are trying to do, or what the problem you have is. All you've really said is this
  18. why don't you look them up? You could start with the reference on w3schools http://www.w3schools.com/jsref/jsref_obj_regexp.asp If you have a specific question, please feel free to ask.
  19. JSON is an interchange format. http://www.json.org/ It is a standard that is meant to be used when transferring data between languages, like PHP and Javascript. So in this case you would just encode your data with PHP (json_encode), and decode with Javascript (JSON.parse). You shouldn't have to manipulate your data with anything else.
  20. I'm not sure what you are trying to do. Are you trying to return executable JS as the response to an AJAX request so that it can be run on the page?
  21. Which version of PHP? Which version of Windows?
  22. The issue is that the DOM needs to load first, in order for event handlers to be able to bind to the elements they're intended for. If you assign an event handler before that element has loaded, well you found what happens. A best practice is to always wrap init code in a window.onload / DOMContentLoaded event, or with jQuery, by using .ready() http://api.jquery.com/ready/ Although you _could_ solve this by loading all JS at the bottom of the page, the real advantage with that practice is that it allows the browser to load the page into view without have to wait for any JS to load (which will block page loading).
  23. all it means is that there is something "wrong" with $client, which is the instance of SoapClient. It was not instantiated correctly which is why you get errors trying to call methods on it. Are you sure your login credentials are correct?
  24. How you want to handle the form submitting is entirely up to you (same page vs different page). I would favor a different page so I don't have to mix HTML and PHP (front end and back end code), and do pre-form submission error handling with JS on the client side.
  25. where did it "go" in the first place? are you referring to something added dynamically after page load? Not sure why you think Angular can do it. It sounds like you need to actually explain where the element comes from in the first place.
×
×
  • Create New...