Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. You mean like the size attribute?
  2. I get the wide screen in Ubuntu 8.04 with FF 3.0.9. I don't really see it as an issue though.
  3. Grow up. Seriously. Unless you need to bump the word count
  4. Im sorry, but please please please learn to bloody read. As has already been stated, applying the md5 algorithm more than once increases the chance of collisions. Hence it is less secure. Why is that so hard to understand? No need for the star -- it's trivially true. There has to be a fixed number of inputs that you have to perform in order to generate all the outputs. Whether or not that's equal to the number of different hashes is a different question (which, incidentally i'm guessing is false -- i bet my bottom dollar that there are collisions within the first |sigma|^32 items [where sigma is the alphabet. I would use 16(hex) but i'm not convinced md5 is limited to hex but i cba to check]). What on earth do you mean by 'computationally secure'? Sha1 would require more processing power in order to generate a collision than md5, and a salted password even more so. But that doesn't imply that it is totally secure.
  5. Yup that is prety good, would take some mathematics to crack that if at all possible. You really are missing the point of hasing. Hashing is a one-way process. It cannot be 'cracked'. Yes, you can use rainbow tables. Yes, you can analyse the algorithm in order to increase the chances of collisions. No, you cannot reverse it. For example, if i tell you a number is 6 mod 7, what was the original number? You can't tell me. You can tell me an infinite amount of numbers that are also 6 mod 7, but you cannot guarantee that you're telling me my original number. Therefore, you cannot reverse it. While this is an extremely simple example, it should illustrate the point.
  6. No, it doesn't. It is, however, sufficient to prevent SQL injection. To quote from my response to a similar topic recently:
  7. Or you could link to a PHP page that uses cURL to post the data. In short, there's a few different ways to do what you're after.
  8. Because, as the manual page says, the parameters should be in the order of month, day then year. You should make the manual first port of call of things like this.
  9. That file ^ doesn't exist. There's nothing else we can really tell you. Have you tried checking that location for it?
  10. You also make your life a lot easier by having forms submit to themselves. You place the processing of the form at the top of the page and can then output the errors where you want. E.g.: <?php $errors = array(); if(count($_POST) > 0){ //form's been submitted...deal with it //check all our errors if(count($errors)==0){ //submit into database. Redirect to thank you page/redisplay blank form/whatever } } ?> Your HTML header goes here Say you want errors to show here: <?php if(count($errors > 0)){ //display them } ?> Show your form: <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> You can also set the value of the field to whatever the user typed...that way they only have to correct the field that was wrong. Eg: <input type="text" value="<?php echo (isset($_POST['age'])) ? $_POST['age'] : ''; ?>" name="age" />
  11. $messages is undefined at that point. Not really sure why PHP isn't telling you that. Odd. Edit: Apparently PHP doesn't tell you if variables are defined afterwards. Weird that.
  12. The general approach is to store a timestamp of their last activity. Obviously this has to be done on every page they visit. The users who are online are then those who have been active inside the last x minutes.
  13. The DATE function just extracts the date part of the timestamp. Hence you're checking if 2009-05-26 > 2009-05-26, which it's obviously not.
  14. Unless you've changed the configuration of your server, you wont be able to use PHP in an HTML page -- it won't get parsed. You can, however, change the extension of the page to .php and then add your PHP as necessary.
  15. Heh, it's too early. There shouldn't be an if there at all: <option value="high" <?php echo (isset($_POST['choice']) && $_POST['choice']=='high') ? 'selected="selected"' : '';?>>Price high to low</option> <option value="low" <?php echo (isset($_POST['choice']) && $_POST['choice']=='low') ? 'selected="selected"' : '';?>>Price low to high</option>
  16. It's overkill. You only need to be using mysql_real_escape_string to prevent the injection. That is plenty sufficient. You might like to use some of the other functions when you output the data, but probably not before. As a general rule of thumb, you should be looking to preserve the original text as much as possible in the database -- for the simple reason that the specifications might change. You might find that, at some point in the future, you really did want any html tags left in, for example.
  17. Yeah, it's standards-related. Attributes without values (i've a feeling there's a proper name for this, but it escapes me this morning) are valid HTML, but not valid XHTML. Personally i prefer to give the value in any case, as it looks better to me. Course, if you get 345353626426 hits a day, saving the extra few characters from your file and thus having a smaller file to serve might be more important
  18. I think we're going to need to see some code. I'm not really sure what the problem is otherwise. Incidentally, you might want to check out the user-contributed notes on this page -- there's a few posts about using the array pointer functions with multi-dimensional arrays.
  19. Edit: Beaten to it, but you should be checking to see if the values have actually been posted, otherwise you might be an undefined index notice. To have an option selected, you need to set the selected tag to "selected". So, you want something like this: <form action="" method="post" name="form1" id="form1" style="margin-bottom:0px;"> Sort by <select name="choice" id="choice"> <option>select choice</option> <option value="high" <?php echo (if isset($_POST['choice']) && $_POST['choice']=='high') ? 'selected="selected"' : '';?>>Price high to low</option> <option value="low" <?php echo (if isset($_POST['choice']) && $_POST['choice']=='low') ? 'selected="selected"' : '';?>>Price low to high</option> </select> <input name="submit" id="submit" type="submit" value="click" /> </form> If you have lots of options in your select box, it'd be easier to set up an array to loop through.
  20. Well how are you assigning the values to each day? Without some sort of logical pairing, your only choice is a big (alright, 365 rows aint big, but i'd still rather not hand type it) table of days and their corresponding 'value'.
  21. You mean you want to output the data in a table with 3 columns? Check out this FAQ/post : http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
  22. That's because the varaibles are , as it says, undefined. If you look at where you 'defined' them: // $naam = (isset($_POST['naam']))''; You've commented out the line, plus the syntax is out. I assume you were after something like: $naam = (isset($_POST['naam'])) ? $_POST['naam'] : ''; You should also note that you're error checking is out. You see you're checking if $error is empty, but you never actually define that variable either.
  23. Why dont you try looking up those things first?
×
×
  • 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.