Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. No they wouldn't. In a method maybe, but not a class. Well, I have heard them say that. So what number do you think is too big in a traditional Procedural Script? So what number do you think is too big in a Class/Object? Debbie There is no magical number. If your script is long because it is inefficient or poorly written, then it should be cleaned up. If your script is long because it has to be, then so be it. If your classes or methods are taking on too much responsibility (doing too many different things) then break them down and make them only responsible for a specific task. For comparison, my user auth class is 411 lines and the login method is 43 lines.
  2. In your Login.php you need to use mysql_real_escape_string() on the username and password. Currently you are putting $_POST variables directly in your query, which means you are susceptible to SQL injection. You needn't worry about sanitizing though on the Login.php. That will just make it easier for hackers.
  3. This will work if you only have one DB connection. If you work with more than one DB server you should use something like: $userData = array_map(function($value) use (&$db2) { return mysql_real_escape_string($value, $db2); }, $_POST); $db2 being the database connection you want to use. Keep in mind this only works on PHP >= 5.3.0
  4. If you only need one username/password, it's a waste to use the database. Just keep it in a php file.
  5. Any website could do that, pretty easily.
  6. *rubs eyes* Yup, time for bed.
  7. The condition isn't met?
  8. I'm starting to get more into Java. Is it typically preferred to use a designer (like NetBeans) when working with Swing? Or is it better to do everything by hand? I know that when it comes to HTML/CSS, dreamweaver WYSIWYG is highly discouraged. Does the same hold true for this?
  9. It will be secure anywhere. The only way people can download the php file is to gain access to the server with FTP or such.
  10. I've decided to go with a different approach, so this is no longer needed.
  11. Except Wordpress is a huge pile of shit.
  12. Maybe I'm just too used to Firebug to give it up. There's a ton of plugins available for it to extend it further as well.
  13. Not sure what to google for? can u give me a good idea https://www.google.com/search?q=flash+avoid+tamper+data&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
  14. You would have to encrypt the data being sent to avoid tamper data. There are lots of discussion on the matter, Google around.
  15. I don't see the point of that. They should just bundle Firebug with Firefox. It's 100x better than both this thing and Chrome dev tools.
  16. You can't have any output before calling the header() function. It looks as though you have whitespace above the <?php tag.
  17. Any errors? What does print_r($_POST); look like?
  18. That's not a problem, the red square will never get that big. The red square will have a username and some other stuff so at most it will be like 30 characters. I'm just working with limited space so I don't want it to be that wide if it doesn't have to be.
  19. scootstah

    BBCode

    Have you checked if you have magic quotes on? If you do it is going to double slash it when you save it to MySQL. You can either look in the php.ini for "magic_quotes_gpc" or run this code if(get_magic_quotes_gpc()) { echo 'magic quotes are on'; }
  20. Two things. 1. MD5 is not encryption, it is hashing. There's a big difference. 2. MD5 is not secure for storing passwords. That just looks like a randomly generated string, nothing special.
  21. For the record, you can either pass the value to strtotime() to get a unix timestamp or use MySQL's UNIX_TIMESTAMP() function. SELECT UNIX_TIMESTAMP(date) . . .
  22. A single equals is an assignment operator. You need two equals ( == ) in your if/elseif statement.
  23. Note that you should NOT be using $_POST directly in your query. Unless you are using prepared statements (which you are not) you are wide open to SQL injection. Pass your $_POST data (and any other user input) through mysql_real_escape_string().
  24. Refer to this: http://jsfiddle.net/3Yg6X/2/ Based on that jsfiddle, I want to get the blue square to the right of the red square. The text in the red square may vary in width, so the blue squares width will have to adapt to a wider red square without dropping below it like it is here.
  25. substr removes a portion of a string, it has nothing to do with what you are trying to do. Unless you actually post code we can't really help you any further.
×
×
  • 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.