Cibiņš Posted July 19, 2009 Report Share Posted July 19, 2009 Sveicināti! Vai kādam nebūtu kāds skripts, kas no MySQL datubāzes izvelk IP adresi un parāda to nevis kā IP adresi bet gan kā vārdu? Vai kāds nezin, kā to uztaisīt? Quote Link to comment Share on other sites More sharing options...
marcis Posted July 19, 2009 Report Share Posted July 19, 2009 Kādu vēl vārdu? Domāji hostname? gethostbyaddr() Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted July 19, 2009 Author Report Share Posted July 19, 2009 (edited) Nini, nu chiniju savai lapai admin sisteemu - uztaisiju IP adreshu sekotaaju, kas fiksee IP adreses. Nu vot lieta tada ka pati lapa "nokjer un iebaazh" to IP adresi datubaazee. Savukaart admin sisteemaa atkal es redzu taas IP adreses, apmekletaas lapas utt. Kkas liidziigs statistikai kar4. Nu un lieta taada, ka es veletos lai admin sisteemaa esoshaa lapa izvelk IP adresi kaa vaardu - teiksim, ja datubaazee atrodas IP adrese 111.111.111.111, tad lai to IP adresi 111.111.111.111 vinjsh parada kaa Gunita. Ja datubaazee ir IP adrese 222.222.222.222, tad lapa admin sisteemaa paraada to IP adresi kaa Maartinjsh..Vaardu sakot admin sisteemaa esoshajaa lapaa noraadu zinaamos IP un pie taa pielieku vaardus, lai lapa raada nevis IP bet vaardu. kaukaa taa, nu ceru ka saprati. Edited July 19, 2009 by MCWeb.lv Quote Link to comment Share on other sites More sharing options...
mounkuls Posted July 19, 2009 Report Share Posted July 19, 2009 pati lapa "nokjer un iebaazh" to IP adresi datubaazee Nu bet kur tad ir problēma "iebaazt" arī atbilstoši vēl tam ierakstam bāzē to Gunita? Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted July 19, 2009 Author Report Share Posted July 19, 2009 (edited) Nu nevajag jau bazt vardu iekshaa bet lai velkot ara to IP adresi araditos tas vards. Katrai IP adresei ir jabut redzamai ieejottubaazees ar datubaazhu paarvaldiibas progu. Bet lapaa, kura velk aaraa taas IP adreses tur vajag kkaadu to f-ju likt if {ip adrese ir 111.111.111.111 echo Gunita} else {izvilkt vienkarshi IP adresi (ja ir nezinaama)}vai kaukaa taa bet nezinu kaa to pierakstiit ar funkciju komandaam lai viss notiek.. Edited July 19, 2009 by MCWeb.lv Quote Link to comment Share on other sites More sharing options...
mounkuls Posted July 19, 2009 Report Share Posted July 19, 2009 Nu bet tas ir tikai normāli, ja atbilstoši IP adresei būs (vai arī nebūs) tekstuāla vērtība. $query_string = "SELECT name FROM ip_tabula WHERE ip=$ip "; $query = mysql_query($query_string); $result = mysql_fetch_array($query); if($result)echo $result[0]; else echo $ip; un viss:) Ja nebūs ierakstīta vērtība, izvadīs IP, bet ja būs, tad vārdu. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.