Jump to content

JAY6390

Members
  • Posts

    825
  • Joined

  • Last visited

Everything posted by JAY6390

  1. Random salts are pointless, since if your security is breached to the point where your passwords are accessible then so will the salts table/field which just makes it redundant. Stick with the single salt
  2. That is the problem. JavaScript spefically doesn't allow you to access the file system (for user security reasons) so you won't actually be able to check the md5 of the file. That function is used to hash passwords etc that are in text fields. The same does not apply to file upload fields. Your best bet would be to get this done with Java instead of JavaScript, but would require the user has Java installed and allows the applet
  3. Pretty sure you will need to do the processing server side unfortunately (although I'm no JS expert). With pictures in different formats you aren't going to be able to tell if they're the same since they're saved differently, and as such have different data entirely. You could "outsmart" this however by logging all image file widths and heights, and having a script search for pictures of duplicate sizes (or aspect ratio's if you want to get really clever with it and they've sometimes been resized) and display them for you to pick off the duplicates
  4. Yes you would. However you would have to have that margin field in every row but it should work fine
  5. It sounds like it's a problem with multibyte strings. Take a look here http://stackoverflow.com/questions/1451144/php-multi-byte-str-replace
  6. Personally I'd keep a list of hashes for current files in a database, and then search the db for a matching hash. That, or prefix each file with their hash, and then search for files starting with that hash in your file folder
  7. Also unless you are actually using the numerical indexes of your selected columns, you should use mysql_fetch_assoc instead of mysql_fetch_array, as it just returns duplicate data (again wasting memory)
  8. No problem. You should always try to make your queries as efficient as possible, to reduce your php processing as much as possible and conserve memory
  9. No problem @Bottyz - Using the method you suggested is going to be a huge waste on resources which is why it's not really ideal
  10. SELECT * FROM `links` WHERE (`out` - `in`) <= 5
  11. The regex option seems a lot simpler to me lol
  12. if(!preg_match('/^\d+$/', $manal) { ... }
  13. You would be better off doing this using the DOM. I have an example on my site: http://www.jaygilford.com/php/php-dom-get-all-pagelinks/ You would just add an if to the foreach to check if $link->getAttribute('class') == 'class_name_here' before adding the link to the array
  14. The easiest method is to learn by practice. Take a look at http://www.regular-expressions.info/ for examples and also this thread http://www.phpfreaks.com/forums/index.php/topic,127902.0.html
  15. %<table[^>]+\bclass="tb"[^>]*>.*?</table>%sm Something like that should do it
  16. in your query select the date using the DATE_FORMAT function along with the date formatting options you require Optionally you can use strtotime() in php to convert the date to a unix timestamp, then format it using the date() function
  17. Not as far as I'm aware. Simplest way I can think of is a foreach foreach($array as &$v) { unset($v[2]); }
  18. You should get the intToWords() function and leave it as it is, then extend upon it with your function (Untested but something like this) function convertCurrencyToWords($number) { if(!is_numeric($number)) return false; $nums = explode('.', $number); $out = intToWords($nums[0]).' dollars'; if(isset($nums[1])) { $out .= ' and '.intToWords($nums[1]).' cents'; } return $out; }
  19. preg_match("/name=([^&]+)/",$params,$res); Is this a query string? ie ?a=somethign&b=somethingelse&name=something If so it might be worth you looking at parse_str()
  20. $M = array(1,2,3,4,5,6,7,8,9,10); $text = 'This is [--M[4]--] something to be [--M[1]--] matched [--M[0]--].'; $regex = '/\[--(M\[\d+\])--\]/e'; $out = preg_replace($regex, '$\\1', $text); echo $out; Output: This is 5 something to be 2 matched 1.
  21. If it works with a static string but not a variable then the variable isn't being set. A function will not stop working based on if you pass a string or a variable with the same string on it. Firstly you need to learn how to make valid HTML <img src="imagefile.php" alt="Dynamic Image" /> Secondly you say you are passing the text via $_GET but that is not the case. If you want to pass it via $_GET you would need imagefile.php?var_name=some_value and then use $_GET['var_name'] in your imagefile.php script to get the data and use it
  22. If that's the case there's an error BEFORE that
  23. Fair enough. If you want it done properly then it would be a drupal install IMO, taking 2 days max
×
×
  • 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.