MārisL Posted November 8, 2007 Report Share Posted November 8, 2007 Vai ir iespējams izveidot, ka urlu redz tikai tie cilvēki, kuru IP adreses ir kaut kur ierakstītas? Link to comment Share on other sites More sharing options...
Vebers Posted November 8, 2007 Report Share Posted November 8, 2007 (edited) Ir. $allowedIPs = array( 0 => '123.124.123.123', 1 => '211.211.221.112' ); if(in_array($_SERVER['REMOTE_ADDR'], $allowedIPs)) { echo 'Reku mans slepenais links! tikai nesaki nevienam par to;)'; } else { echo 'Tu nedrīksti redzēt manu linku!'; } P.S. Neaizmirsit, ka nekatram datoram ir sava IP! Var būt tā, ka, piemēram, visai skolai ir viena IP! Edited November 8, 2007 by MakaTaNaw Link to comment Share on other sites More sharing options...
andrisp Posted November 8, 2007 Report Share Posted November 8, 2007 MakaTaNaw, kāda jēga definēt pašam ar roku indexu nosaukumus ? :) $allowedIPs = array( '123.124.123.123', '211.211.221.112' ); Link to comment Share on other sites More sharing options...
Vebers Posted November 8, 2007 Report Share Posted November 8, 2007 Šim gadījumam nav nepieciešams, bet šķiet, ka tāds kā pieradums :) Link to comment Share on other sites More sharing options...
MārisL Posted November 8, 2007 Author Report Share Posted November 8, 2007 paldies viss iet perfekti. Kāda atšķirība '123.124.123.123', '211.211.221.112' no 0 => '123.124.123.123', 1 => '211.211.221.112' ? Link to comment Share on other sites More sharing options...
black Posted November 8, 2007 Report Share Posted November 8, 2007 otrais variants aizņem vairāk vietas kodā Link to comment Share on other sites More sharing options...
andrisp Posted November 8, 2007 Report Share Posted November 8, 2007 Šinī gadijumā pilnīgi nekāda. Pirmajā variantā indexiem nosaukumi automātiski numurējas: 0, 1, 2, 3 utt. Link to comment Share on other sites More sharing options...
Val Posted November 8, 2007 Report Share Posted November 8, 2007 Kā minimums, tajos linkos arī vajag tādu pašu pārbaudi uz ip. Link to comment Share on other sites More sharing options...
MārisL Posted November 8, 2007 Author Report Share Posted November 8, 2007 Tur nav nozīmē, jo tā lapa ir aizsargāta ar paroli Link to comment Share on other sites More sharing options...
Kavacky Posted November 9, 2007 Report Share Posted November 9, 2007 Nu bet ja paroli uzzina banned adreses īpašnieks? Link to comment Share on other sites More sharing options...
MārisL Posted November 9, 2007 Author Report Share Posted November 9, 2007 Ā. Tas gan. Pievienošu Link to comment Share on other sites More sharing options...
Recommended Posts