Jump to content

thescientist

Moderator
  • Posts

    8,682
  • Joined

  • Last visited

Posts posted by thescientist

  1. It's hard to read your code, you should at least format it with proper indentation. You also don't mention what is happening. Are you checking for errors? What about the success of the request / response to the server?

  2. and that some user browsers might even turn down js. jQuery is a better alternative for browser support.

     

    Just to be clear, jQuery is still just JavaScript. jQuery is just a documented, cross browser tested, helpful collection of API's such that you don't have to figure out the unique browser differences yourself.

  3. Typically jQuery UI plugins act on a set of DOM elements as defined / expected by the plugin developer in their documentation. You still haven't show any the markup that your using. This is what is meant by showing all of your code. Any documentation for the plugin would also be useful.

  4. so in order to have efficient web site html script and so on and be up to date it seems that validity from the validator can basically leave no room for creativity. does that sound correct? I mean If I decided to use an element that is not typically used in such a way, does that hinder the web site in any way. I have seen some sites that could benefit from some basic editing, also seen some that are laid out "incorrectly" and yet look great and are still navigable and useful.

     

    That's not the point or the counter argument being made though. Those tags are considered deprecated for a reason, using them locks you into a position of your code breaking unexpectedly whenever a browser vendor finally decides to not support it. As mentioned, in the case of <center>, as mentioned there are much better ways of accomplishing that task.

     

    In the case of technology and especially web languages, new features are added all the time, which comes in the forms of either creating a spec, improving an existing one, or removing them (deprecation).

  5. I don't see you turning error reporting on and I don't see where you are creating a new instance of ZipArchive. Also, how are you testing for success / failure of the open method?

    http://php.net/manual/en/ziparchive.open.php

     

    Also, your formatting (lack of returns between lines) makes your code hard to read. I would recommend you post with proper formatting so it's easier for other users to follow along.

  6. don't fully understand sql injection but do understand enough to know that people add text to there field inputs that they submitting , that will comprise you're database.

     

    however I don't see how they can inject if there is no text field for them to type in.

     

    I did think maybe in the URL they could do

    page.php?varname=therecodehere

    But they would need to know what the varname is I would think.

     

    I did search for sql injection attack examples and found below link, which gave me a bit more info on it.

     

    http://www.unixwiz.net/techtips/sql-injection.html

     

    Am not disputing that SQL Injection is a thing, it obviously is, just don't see how an attacker can do it, if there no text field for them to use.

     

    That's likely because you're only assuming that a browser is the only way to make an HTTP request. There are many other ways to make a request to your server, such as a command line utility like cURL.

     

    If a user makes requests through your site to the server they can see that in the network tabs. From there they can just reproduce that request through command line for example, in a script that runs in a loop until it get's a hit.

  7. is there really any chance of someone using sql injection with select queries?

     

    absolutely.

     

    ANYTIME time you are accepting any data from an outside request and use it in your code, you should validate and sanitize that data (this isn't limited to just when used with SQL queries, btw). you should really read up about SQL injection if you're still unclear. In fact, w3schools uses the SELECT query as an example.

    http://www.w3schools.com/sql/sql_injection.asp

     

    Also, relevant XKCD

    https://xkcd.com/327/

  8. Unbelievable. Using jquery to hack it with inline styling and obsolete font tag and attributes, instead of taking the time to write the CSS correctly. I need to move on to something else before I puke.

     

    I'm not sure how a comment like this constructive. Maybe you could care to enlighten this user instead? Everyone needs to start somewhere

  9. if you give two functions the same name, then the second one will clobber the first one. The solution to this is to give your functions meaningful names that describe what they do (typically using verbs) and keep them small and scoped to just one responsibility.

    • Like 1
  10. So is the issue with fetching the information from the database then? Can you confirm it's being entered into the database correctly? Please be detailed and show code as requested above.

  11. Turns out it was as simple as equalling one object to the other. However, for some reason since this object contains objects with properties or whatever it is doing, I didn't make the connection to the other and didn't realize it is still that simple, just needed the period there.

     

    Just make sure you read his post carefully though

     

    Just assign the variable to myObject.C. e.g.:

    myObject.C = myObject.B;
    However, that's not going to create a copy, it's going to create a link. Both B and C are now pointing to the same object, not different copies. You need to clone the object, there is a description about that here:http://stackoverflow.com/questions/728360/most-elegant-way-to-clone-a-javascript-object

     

     

    So unless you want to changes to B to propagate to C, then you have to use clone.

×
×
  • Create New...