Jump to content

kaz_64

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by kaz_64

  1. yes, i know that php has aspell extentions, but i hadn't been able to find any benchmarks for it and this application i'm developing would be a high trafic one... i have yet to compare them
  2. works fine for me in Canada! Another solution is GeoLiteCountry offered by MaxMind, it is free and uses a binary database, they also offer GeoLiteCity which even gives you the longitude and latitude of the city reported by their IP, which can be very useful for google maps
  3. A very nice system, I received no php errors so I have no advice for you there only a small bit of design advice: you should probably remove the (comming eventually) for your download of the day untill you get it running. A neat way I do it is i set a constant for every system i have (true for operational, false for not) and that way you can say if(__DL_DAY__) echo "foobar" (or what ever you wish to name your constant) and it you want to get even more fancy you can set the constant based on a value from your database on a side note you could use variable in the same way but the nice thing about constants is that once they are set at the execution of your script is that they cannot be modified for the rest of the execution... i find this useful because there's no accidentally changing a variable the could give you an error else where on your page
  4. I have created a mysql database of most english words (approx. 102,115) and their metaphone key... this is a function that takes a word and creates a key for it based on how it sounds I am using it to provide some spell checking/spelling suggestion abilities in a search engine I am building. It is roughly 2.2 MB unzipped, 602 Kb zipped. the maximum upload size on the forum is 500 Kb, but I will find some free host to put it on if there is any interest in it. note: this database DOESN'T contain any definitions for the words. tech details: MyISAM, UTF-8 unicode, 26 tables A-Z based off of GCIDE_XML
  5. Worked perfectly..... Calgary, Alberta, Canada
  6. i rely on session as well..... i know it can be manipulated as well...  session is what i use primarily the value if copied from the cookie only if session isn't set. also for the fact that a user might not allow cookies. the only thing store in a cookie/session for my site is either a zero or an MD5 hash... and here's how the hash is generated: [code=php:0] $h12 = time() + (60 * 60 * 12); $key = "$h12 $uid ".$_POST['username']." ".$_POST['password']; $logkey = bin2hex(md5($key, TRUE)); [/code] so if someone can fake a hash for my site then they already have the username AND password in [u]unencrypted[/u] form and they would have to be able to write it to my database somehow for it to validate..... and if they could do all that.... then i'm pretty sure my site would be taking a huge dive :P and if someone manages to get their hands on a genuine cookie of mine, they would have to use it within 12 hours or it'd expire. p.s. i always turn off magic quotes, they're good in theory but take too much away from the developer... you should always have your code written to handle escape characters.
  7. thanks for replying... may i ask how it is unsecure? both of my functions that query the database with user input use mysql_escape_string() before they run any SQL, i'm sorry if i'm not catching on :-\ UPDATE: i just tried an SQL injection attack as predicted my script said it was an invalid username or password
  8. kaz_64

    yes or no?

    if your in canada and your on telus's network the format is text only email and the address is [email protected] i use it all the time.. it's it's great for getting critical server errors or notifications quickly while your out and about, it's free for any telus phone and the message usually arives within 2 minutes.... so useful
  9. i'm setting up a community website from scratch, i was wondering if this authentication method is secure or not. the function names should be self explanitory... but just incase... userpassmatch($user, $pass) returns true if if the user/pass match getuid($uid) returns false if user doesn't exist or the user id an integer if the user exists both these functions use mysql_escape_string() before checking records here's how i use it, as you can see it only sets one session variable and one cookie, calling this value "logged".... if the user is not logged in this variable and cookie are set to 0. on every page a script checks to make sure that the "logkey" as i call it is valid and not expired, it is only valid for 12 hours and every logkey in the database must be unique. i was wondering if you see any flaws or possible security leaks in this code this is my login script [code=php:0] elseif (isset($_POST['submit']) && userpassmatch($_POST['username'], $_POST['password'])){ $uid = getuid($_POST['username']); $h12 = time() + (60 * 60 * 12); $key = "$h12 $uid ".$_POST['username']." ".$_POST['password']; $logexpire = date('Y-m-d H:i:s', $h12); $logkey = bin2hex(md5($key, TRUE)); $ip = $_SERVER['REMOTE_ADDR']; //sql to login $query = "UPDATE users SET online='1', logkey='$logkey', logexpire='$logexpire', last_active=NOW(), last_ip='$ip' WHERE uid=$uid;"; //update database $connection = mysql_pconnect("localhost", $mysql_user, $mysql_pass) or die ('Unable to connect to database.<br />Please try loging again. If you continue to see this message, please email <a href=""></a>."'); mysql_select_db("userdata") or die ('Unable to select database.<br />Please try loging in again. If you continue to see this message, please email <a href=""></a>.'); $result = mysql_query($query) or die ('Unable to insert data into database.<br />Please try loging in again. If you continue to see this message, please email <a href="mailto:"></a>.'); //set session and cookie setcookie("logged", $logkey, $h12, "/"); $_SESSION['logged'] = $logkey; //show index.php include('index.php'); }[/code]
  10. thank you very much.... the table in that section is only a temporary one, i'll be changing it to divs once i finish the work on some other sections... but i still have the problem of the window resizing.... it only looks the way it's supposed to when the window is maximized :(
  11. Hi, I'm currently designing a new community site and this is my first time doing a layout using 100% divs and no tables, so just bear with me if i don't understand something at first or if this is super easy to fix :P also i'd like to apologize in advance if this is covered somewhere else, i searched but i didn't find anything that looked like it could apply to my problem. so here's my problem, my site looks exactly the way i want it to when the window is maximized, but as soon as you resize it, everything goes horribly wrong on the top nav bar, i have tried setting overflow to auto and other things like that, but nothing seems to work. [url=http://sdd.listenuppunk.net/]http://sdd.listenuppunk.net/[/url]
×
×
  • 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.