Last active
June 19, 2018 08:58
-
-
Save sivasbaskan/9158946428b80aec172ed7912ad996a7 to your computer and use it in GitHub Desktop.
Php ip adresine göre dil veyahut para birimi yönlendirme scripti
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- PHP - Statik Kur Yada Dil Çevirme Kodu --> | |
<?php | |
require_once("geos_ip/geoip.inc"); | |
require_once("geos_ip/geoipregionvars.php"); | |
require_once("geos_ip/geoipcity.inc"); | |
$gi = geoip_open("geos_ip/data/GeoIP.dat",GEOIP_STANDARD); | |
$country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']); | |
geoip_close($gi); | |
if($country_code == "US") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 75$</span>'; | |
} | |
elseif($country_code == "EN") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 75$</span>'; | |
} | |
elseif($country_code == "TR") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 160.TL</span> <span style="text-decoration: underline;">Kargo Ücreti + 15.TL</span>'; | |
} | |
elseif($country_code == "AT") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
elseif($country_code == "CH") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 75$</span>'; | |
} | |
elseif($country_code == "DZ") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
elseif($country_code == "NL") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
elseif($country_code == "DK") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
elseif($country_code == "BE") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
elseif($country_code == "AE") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
elseif($country_code == "SA") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
elseif($country_code == "FR") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
elseif($country_code == "SE") | |
{ | |
echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 175€</span>'; | |
} | |
else { echo '<span style="font-size:28px; font-weight:bold; color:#cc1b6f;">Fiyat: 75$</span>'; } | |
?> | |
<!-- PHP - Statik Kur Yada Dil Çevirme Kodu --> | |
<!-- PHP - Statik Kur Yada Dil URL Yönlendirme Kodu --> | |
<?php | |
require_once("geos_ip/geoip.inc"); | |
require_once("geos_ip/geoipregionvars.php"); | |
require_once("geos_ip/geoipcity.inc"); | |
$gi = geoip_open("geos_ip/data/GeoIP.dat",GEOIP_STANDARD); | |
$country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']); | |
geoip_close($gi); | |
if($country_code == 'US') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=dolar"); | |
exit(); | |
} | |
elseif($country_code == 'EN') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=dolar"); | |
exit(); | |
} | |
elseif($country_code == 'TR') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=turklirasi"); | |
exit(); | |
} | |
elseif($country_code == 'AT') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=euro"); | |
exit(); | |
} | |
elseif($country_code == 'CH') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=dolar"); | |
exit(); | |
} | |
elseif($country_code == 'DZ') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=euro"); | |
exit(); | |
} | |
elseif($country_code == 'NL') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=euro"); | |
exit(); | |
} | |
elseif($country_code == 'DK') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=euro"); | |
exit(); | |
} | |
elseif($country_code == 'BE') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=euro"); | |
exit(); | |
} | |
elseif($country_code == 'AE') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=dolar"); | |
exit(); | |
} | |
elseif($country_code == 'SA') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=euro"); | |
exit(); | |
} | |
elseif($country_code == 'FR') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=euro"); | |
exit(); | |
} | |
elseif($country_code == 'SE') | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=euro"); | |
exit(); | |
} | |
else | |
{ | |
header("location: ".$_SERVER["HTTP_REFERER"]."?kur=dolar"); | |
exit(); | |
} | |
?> | |
<!-- PHP - Statik Kur Yada Dil URL Yönlendirme Kodu Not Dil Yönlendirmek İçin ?kur= yerine en, tr, fr.php gibi dosyalar country_code göre çağırılır! --> | |
<!-- PHP - Dinamik Kur Yada Dil Yönlendirme Kodu --> | |
<?php | |
require_once("geos_ip/geoip.inc"); | |
require_once("geos_ip/geoipregionvars.php"); | |
require_once("geos_ip/geoipcity.inc"); | |
$gi = geoip_open("geos_ip/data/GeoIP.dat",GEOIP_STANDARD); | |
$country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']); | |
geoip_close($gi); | |
$urunlistele= mysql_query("SELECT * FROM urunler ); while($urunx= mysql_fetch_object($urunlistele)){ | |
?> | |
<?php | |
if($country_code == 'US') | |
{ | |
echo "<ins> $urunx->fiyat_dolar $</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_dolar_eski $</del>"; | |
} | |
elseif($country_code == 'EN') | |
{ | |
echo "<ins> $urunx->fiyat_dolar $</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_dolar_eski $</del>"; | |
} | |
elseif($country_code == 'TR') | |
{ | |
echo "<ins> $urunx->urun_fiyati .TL</ins>"; | |
echo " "; | |
echo "<del> $urunx->eski_fiyat .TL</del>"; | |
} | |
elseif($country_code == 'AT') | |
{ | |
echo "<ins> $urunx->fiyat_euro €</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_euro_eski €</del>"; | |
} | |
elseif($country_code == 'CH') | |
{ | |
echo "<ins> $urunx->fiyat_dolar $</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_dolar_eski $</del>"; | |
} | |
elseif($country_code == 'DZ') | |
{ | |
echo "<ins> $urunx->fiyat_euro €</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_euro_eski €</del>"; | |
} | |
elseif($country_code == 'NL') | |
{ | |
echo "<ins> $urunx->fiyat_euro €</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_euro_eski €</del>"; | |
} | |
elseif($country_code == 'DK') | |
{ | |
echo "<ins> $urunx->fiyat_euro €</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_euro_eski €</del>"; | |
} | |
elseif($country_code == 'BE') | |
{ | |
echo "<ins> $urunx->fiyat_euro €</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_euro_eski €</del>"; | |
} | |
elseif($country_code == 'AE') | |
{ | |
echo "<ins> $urunx->fiyat_dolar $</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_dolar_eski $</del>"; | |
} | |
elseif($country_code == 'SA') | |
{ | |
echo "<ins> $urunx->fiyat_euro €</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_euro_eski €</del>"; | |
} | |
elseif($country_code == 'FR') | |
{ | |
echo "<ins> $urunx->fiyat_euro €</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_euro_eski €</del>"; | |
} | |
elseif($country_code == 'SE') | |
{ | |
echo "<ins> $urunx->fiyat_euro €</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_euro_eski €</del>"; | |
} | |
else | |
{ | |
echo "<ins> $urunx->fiyat_dolar $</ins>"; | |
echo " "; | |
echo "<del> $urunx->fiyat_dolar_eski $</del>"; | |
} | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Arkadaşlar sorusu olan arkadaşlara yada ekstra bir şeyler yaptırmak isteyen arkadaşlara yardımcı olurum bilginize!