Jump to content

Cook

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Everything posted by Cook

  1. I've reworked my suggestion now that I understand better what you need. But again you'll have to have your host put this into an .htaccess for you if they don't allow you to do it yourself. RewriteEngine On RewriteRule ^/news\.php\?article=(.*) http://www.netgeekz.net/news/$1/ [R=301,L]
  2. Cook

    select problem

    [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']select[/span] count(*) from `clients` where `category` like '%,12,%' or `category` like '12,%' or `category` like '%,12' [!--sql2--][/div][!--sql3--]
  3. Cook

    select problem

    Frankly having a list of categories separated by commas is not the best db design you could imagine. Anyway try this one (provided there's no spaces between the cat numbers and the commas): select count(*) from `clients` where `category` like '%,12,%'
  4. Very likely it's your query that is malformed. Check out the pinned topics in the PHP Newbie Help forum.
  5. I think your next option is to contact your host's technical support...
  6. Cook

    DateDiff Question

    If what you're after is all dates later than (or equal to) now, this is a simpler way of doing it: [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] * FROM `data_events` AS `d` WHERE `[span style=\'color:blue;font-weight:bold\']Delete[/span]d` = 0 AND `d`.`sDate`>= NOW() ORDER BY `sDate` LIMIT 5 [!--sql2--][/div][!--sql3--]
  7. Google 'mysql tutorial'. Alternatively check out the membership systems tutorials on this site.
  8. What about .htaccess? Does the rewrite rule work?
  9. I agree with your php.ini change, as a matter of fact it is what I suggested two posts above. Now I think it would be possible to remove the PHPSESSID from the URL with mod_rewrite too with a rule looking something like this: RewriteEngine On RewriteRule (.*)&PHPSESSID $1 I haven't tried this, but I reckon it should work; However it relies on two assumptions left to be verified: 1- PHP rewrites the URL by appending the PHPSESSID at the very end of the URL; 2- PHP rewrites the URL before Apache does, so that PHPSESSID is in the URL at the time the above rule is run.
  10. The PHPSESSID automatic appending to URLs should be turned off with what I gave you for your php.ini. Weird if it's not. It works just fine for me. Do you have control over your php.ini? Is your setup alright? You can try and change the settings at run-time with ini_set() otherwise . As to the mod_rewrite, this rule is fairly straightforward, am surprised it does not work either. Similarly to the above, do you have control over your .htaccess? Is your setup alright? Is mod_rewrite part of your Apache config (it is an optional module)?
  11. TJ, the answer to your question is right here in this thread if you care to read it all. Hint: post #3.
  12. Cook

    Mod_rewrite

    Try backslashing the dot of your .php extension.
  13. To turn the PHPSESSID rewrite off, you would have to edit your php.ini so that: session.use_cookies = On session.use_only_cookies = On url_rewriter.tags = None As to your second issue, something like this in your .htaccess should to the trick: RewriteEngine On RewriteRule ^/news/view_news\.php http://www.netgeekz.net/news/archive/30/ [R=301,L]
  14. Hey man, willing to help, but not sure I understand what you want to transform into what. What's the starting data, and what is it you want to have at the end of the rewrite? Can you elaborate a little?
  15. Your strings in the VALUES() clause should be enclosed with single-quotes ('), not backticks (`).
  16. Must have to do with the maximum length of text a textarea can store. These things are not limitless...
  17. Just drop the single quotes around NOW(). This is a MySQL function call, not a string. What you're instructing MySQL to do here is to store the string NOW() into your timestamp column, which does not work, because the string NOW() is not a value MySQL can interpret as a date/time value.
  18. Make sure your replace the ',' with '.' (the string concatenation operation) in you md5() call. To check the password supplied is correct, just apply the same function to the input provided by the user, then do a string comparison with the value stored in the db. NB: The comparison needs not be case sensitive, as the md5 digest is made up of 32 hex digits; you can use strcasecmp().
  19. True. Along the same line, something like this: [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]$digest = md5(md5($message) . md5($salt));[/span][!--PHP-Foot--][/div][!--PHP-EFoot--] is pretty much unbreakable too.
  20. One extra thing to note tho is that MD5 digests cannot be decrypted, ie you cannot get the original data from an MD5 digest. MD5 is a hash algorithm that produces a signature from the original data that is such that it is very very highly improbable that two different pieces of original data produce the same MD5 digest. Therefore MD5 is a good choice to authenticate data (as opposed to truly encrypting it), ie ensure the other party is indeed who they claim to be. The consequence of all this above is that if your users forget their passwords, you can't give it to them in any way. Instead you would have to generate a new one randomly and send that new password to your users. All that said, using a seed string (also referred to as salt) as widgetapps suggest is a very good idea, as it makes it much more difficult for dictionary or brute force attacks to succeed in cracking your security.
  21. You need to change your date column type to DATETIME. Reason is MySQL automatically updates the first TIMESTAMP column it encounters in a table with the date and time of the last operation performed on the row. Check out the manual under TIMESTAMP for more.
  22. Google 'mysql tutorial' gives me plenty of interesting links, here is the first one of the list.
  23. Hi SA, With 15K new IDs a day, you would still need 6,666,666 days to reach 99,999,999,999... That only 18,252 years. Not sure you'll be around to see it happen.
×
×
  • 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.