Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Sure has a lot of entries about snoring... Anyways, what exactly do you want us to comment on? It's just a wordpress install with the default theme. I also removed the poll as it didn't really serve any purpose other than voting for the two same options, none of them being answers to the question asked.
  2. You could setup an associative array in your script: <?php $fruits = array( 1 => 'apple.jpg', 2 => 'orange.jpg', // etc. ); ?> Then to get the filename of the image just do $filename = $fruits[$num]; or something like that.
  3. Just use whatever program you can write text in.
  4. First of all, your question is not "urgent"... To get the decimals off you can use round(), ceil() or floor().
  5. Hmm... I don't know. I've known about this for several months.
  6. The funny part is...? The name? It makes perfectly sense seeing as Windows Vista is using the NT 6.0 kernel.
  7. You would use AND and not && in SQL.
  8. You can see the changelog here: http://www.php.net/ChangeLog-5.php How are things not working? Are there any errors?
  9. Overloading is something which is quite commonly used. Take for example the + operator in some languages. In some languages if it's used with strings it will concatenate them, but if it's used with e.g. two integer values then they are added to each other. That's an example of overloading polymorphism. I'd also agree that using the magic __get() and __set() methods would be better than dynamically creating class members.
  10. Then you'll still have a problem if you're an open source developer.
  11. Take a look at the HTTP headers mentioned in this post: http://www.phpfreaks.com/forums/index.php/topic,95433.0.html
  12. Why not just write it yourself. It's quite trivial. Add data to database and send emails.
  13. Set a longer lifetime and regenerate the ID often. Let me give you an example. Someone once found a security hole in The Pirate Bay resulting in allowing them to get a database dump of the users table. The passwords were however hashed and salted so the information was useless. Had the salt been stored alongside the password then the salting would have been useless. Source: http://thepiratebay.org/blog/68 Again, not entirely true. Many users use the same password for multiple purposes. Say for instance the the attacker gets the user's password to resource A, but the user happens to have used the same password for resource B which means that if the attacker has the password then he'll have access to both of those resources. I can again provide you with a real-world example. Somebody once found a security hole in one of the PHP Freaks administrators' private websites which allowed him to get the hashed version of the admin's password. He was able to crack that password and the admin happened to use the same password here which enabled the hacker to elevate his privileges here using the admin credentials.
  14. The hash can be retrieved in many ways... If a user has a cookie to remember their credentials, its usually includes a hashed version of their password. This information is sent on page requests, and can be intercepted. If your database is compromised, maybe securing your hashed passwords isn't the big worry. What's the point of trying to protect data with a username/pass when the data can be grabbed another way? You're not supposed to store the hashed password (nor the username) in a cookie on the client side. You kind of told yourself why you shouldn't. Just use one cookie with a session id. If the only place where the salt is ever stored in the database then the salting is rendered completely useless if the database is compromised. It's like hanging the key to a locked vault on the outside or having a post-it with your password on your monitor. By storing the salt another place the attacker will have to gain access to both the hash (i.e. get access to the database) AND get access to wherever your salt or salting algorithm is stored (e.g. the filesystem).
  15. You could use output buffering if your template file contained PHP code which had to be evaluated. Then you could use include() or require() instead of file_get_contents(). By doing so there would be output - output which you might have to capture using the output buffering functions.
  16. @redarrow: Your server is amazing. It's able to run an HTTPd without being built yet :o [quote=http://freesingles.ath.cx]Server under construction[/quote]
  17. What's wrong with that code?
  18. It's because the string contains forward slashes which is what you're using as delimiter in the regular expression. You could do addcslashes($string, '/'); to fix that.
  19. Daniel, I meant write the number in hexadecimal format in the code. It helps translations into bit patterns in our head more than the decimal format does. I don't see why that's true. 1 = 00000001, 2 = 00000010, 4 = 00000100, 8 = 00001000, 16 = 00010000, 32 = 00100000, 64 = 01000000, 128 = 10000000 etc. Each time you double the number represented in BASE 10 the bit which is turned on is moved one place to the left in BASE 2.
  20. Yes, that would be 0x1f. I too find it easier to visualize the "bits string", hence me suggesting you to leave it as a comment on the definition of those constants. However, when doing the translation to an integer, do not feel tempted to use base 10. Use instead hexadecimals as demonstrated by us. You will see that conversions from hexadecimal to binary are much easier to do in your head. After a while you may be able to even do it without much thinking and you no longer will need those bit strings as a comment. Uh... you can use BASE 10. <?php define("READ", 1); define("CREATE", 2); define("DELETE", 4); define("MODIFY", ; define("CONTROL", 16); $rd = READ | CREATE; $rd = $rd | DELETE | MODIFY; echo decbin($rd) . "<br><br>"; $rd = $rd &~READ; echo decbin($rd) . "<br><br>"; ?> That is also what you're doing when setting the error reporting level. It uses the decimal system as well - check out the manual.
  21. Yes. Or perhaps in some sort of configuration file.
  22. He said he just installed it. In that case the password is blank and it's quite likely that the only existent user is the root user.
  23. That hostname refers to where connections can come from. That would be the IP of your server where your website is installed. You could also just set it to any.
  24. In that case the hostname will have to be your IP address.
  25. The hostname would be localhost. If it didn't tell you to choose any passwords, then the root user's password is probably blank. You can use phpmyadmin to change the root user's password and create new users.
×
×
  • 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.