edw Posted April 11, 2007 Report Share Posted April 11, 2007 sveiciens visiem.. velejos pajautat varbut kadam ir aizkeries tads kods kas skaita cilvekus kas apmekle lapu, bet veletos lai ari visas ip tiktu saglabas mysql tabula + vel paraditos amekletaji sonien un vispar kopa.... ;) Link to comment Share on other sites More sharing options...
KillerBean Posted April 12, 2007 Report Share Posted April 12, 2007 (edited) Gatava nav, bet to tachu var uzrakstiit 10 minuutees.. Edited April 12, 2007 by KillerBean Link to comment Share on other sites More sharing options...
Grey_Wolf Posted April 12, 2007 Report Share Posted April 12, 2007 (edited) Datumam erti vari izmanto MYSQL f-ju NOW(), savukart IP pierakstam lietot INTEGER lauku ... Lai bez problemaam to izmantotu ir 2 MYSQL f-jas kas ip parversh INTEGER un atpakal.... INET_ATON() IP ==> INT INET_NTOA() INT ==> IP piemeram ierakstot DB: INSERT INTO tabulis ( ip, datums ) VALUES (INET_ATON('255.255.255.255'), NOW() ) pie nolasishanas: SELECT INET_NTOA(ip) AS ip_adrese , datums FROM tabulis Parejos laukus tachu varesi pielikt? IP adreses dabushanai $_SERVER['REMOTE_ADDR']. P.S. protams to 255.255... vietaa usera IP.. ;) Edited April 12, 2007 by Grey_Wolf Link to comment Share on other sites More sharing options...
Paulinjsh Posted April 12, 2007 Report Share Posted April 12, 2007 (edited) INET_ATON() un INET_NTOA() vietā var lietot php funkcijas ip2long() un long2ip() Edited April 12, 2007 by Paulinjsh Link to comment Share on other sites More sharing options...
andrisp Posted April 12, 2007 Report Share Posted April 12, 2007 Iesaku pievērst uzmanību, lietojot ip2long: - http://lv2.php.net/manual/en/function.ip2long.php#73288 Kā arī: Because PHP's integer type is signed, and many IP addresses will result in negative integers, you need to use the "%u" formatter of sprintf() or printf() to get the string representation of the unsigned IP address. Link to comment Share on other sites More sharing options...
Recommended Posts