Jump to content

Ken2k7

Members
  • Posts

    5,196
  • Joined

  • Last visited

    Never

Everything posted by Ken2k7

  1. Let's say you have all the filenames in the array $files. So your job is to get all the file names and store then into that array. Make sure they have the correct path of the file so that filemtime can reference it. <?php function LastModifiedCompare ($a, $b) { return filemtime($a) > filemtime($b); } usort($files, 'LastModifiedCompare'); var_dump($files); // list all of them starting from most recent modified to last.
  2. You'll have to learn about SEO.
  3. Do files store the data for date creation? I think it's just last accessed/last modified. If you're on a Linux server, you can easily run the command: ls -alt to list them descendingly and ls -ralt for ascending.
  4. Wait, what do you mean when you run test1.php? Where are the files located?
  5. supposeably? lol, very nice. Can you make the following changes? Replace: setcookie("user1", "Alex Porter", time()+3600); With: $cookie = setcookie("user1", "Alex Porter", time()+3600); echo $cookie? 'woot!' : 'omg fail'; Tell me what that prints out.
  6. I can see such a software for just 1 table, but when you need to make it work for more than 1 table, the task gets astronomically harder.
  7. Josh, after the user is logged in, a session variable is created to store a value stating the user is logged in. So, if the user were to go to another page, you must check if the user is logged in by checking the value of the session variable. Otherwise, how would you know if the user is logged in or not? Does this make sense?
  8. onthespot, please note that thorpe said "it's not usually appropriate". That doesn't mean you can't, it's just not recommended. But if you are going to do that, you need to check for the value of the method and take the necessary actions.
  9. That's a display issue, not a programming issue. You can have a DIV aligned like that so the contents display the way you want it.
  10. litebearer, $three_days is more like 1 day.
  11. That doesn't make any sense. If you have PHP automate it, then the system is useless and won't protect anything. If you want to prevent hotlinking, I would suggest using .htaccess. And I don't know what you mean by impossible because of a Firefox bug because I've definitely had no issues with it.
  12. You're confused because you're depending on us to write the code perfectly and 100% working for you rather than trying to understand the logic on how you would go about doing it. Obviously if you don't understand the logic, nothing we post will make much sense as evident in this topic. So allow me to break down everything in this topic for you to clear up that confusion. Your problem: The dates are in the format of "mm.dd.yyyy" and you want to select all records within the last 30 days. The issue is that "mm.dd.yyyy" is not in a valid date format; so we know the type of the column field in the database is not a valid date type. Due to that, it's hard to write an efficient SQL that selects what you want. Solution: The suggestion was made to convert that into a proper date type. I suggested to create a new column with the type timestamp. Then you run an UPDATE SQL that fills in the values for the column you just created. All the UPDATE SQL should do is fill in the data for the new column you created. It should not change the value of the "mm.dd.yyyy" data whatsoever. Example: > Create a new column of type timestamp. I'll call it new_date. +-------+---------------+--------------+ | id | your_date | new_date | +-------+---------------+--------------+ | 5 | 05.12.2009 | | +-------+---------------+--------------+ > Run an UPDATE SQL that gets the value in your_date and re-write it in the proper date format and store it into new_date. Please refer to my post on a few key and useful MySQL string functions that should help you in transforming the text. +-------+---------------+--------------+ | id | your_date | new_date | +-------+---------------+--------------+ | 5 | 05.12.2009 | 2009-05-12 | +-------+---------------+--------------+ Then after you have that fixed, you can run a SELECT SQL similar to the one 947740 posted in the first reply in this topic.
  13. If that's the case, let me see if I get this, you know the variable names but not the input field names? WTF?
  14. Sorry.. the cookie doesn't seem to be setting. How are you verifying that?
  15. Huh?
  16. curl_multi_init
  17. What really weird stuff?
  18. What's wrong with the code? Do you mean the cookie isn't being set or are the echos not working?
  19. You don't even need to SELECT them. MySQL has some useful string functions like LEFT(), RIGHT(), LOCATE().
  20. That's a permission error. Check the file permissions. If they're set correctly, check for any .htaccess files.
  21. Create a new column with type timestamp and then run an update SQL.
  22. siric, md5 is not an encryption process; it's a hashing process.
  23. A good practice is to store the SQL string into a variable before running it. $sql = "UPDATE tbl_ticket set col_techcomments='$newtechcomments' where id = $_POST['ticketid']";. That way, you can echo out $sql and verify that it's correct before you run it using mysql_query.
  24. Oh definitely don't give each a database connection. Just register them into a database with username and password, but make sure you hash the password for security.
  25. I'm confused. What is it that you're trying to do? I'm asking for the overall picture here.
×
×
  • 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.