hello there, i have this php code if(isset($_POST['submit']) || (isGeorgianIp($_SERVER['REMOTE_ADDR'])==true)) { require ("geo/georgia.php"); die(); } elseif (isGeorgianIp($_SERVER['REMOTE_ADDR'])==false)) { require ("en/english.php"); die(); } PHP: it is working, but georgian people can't see en/english.php file. how to fix this problem ? i have tried to create other button but it is not working well please need help.
Try this code, if(isGeorgianIp($_SERVER['REMOTE_ADDR'])) { // Georgian require("geo/georgia.php"); exit(0); }else{ // English require("en/english.php"); exit(0); } PHP:
Read the first line of your code. The first if statement will always stay true because $_POST['submit'] is always set therefore true. The whole statement will be true if one is true.
ok, but if i am georgian how to choose english file ? (in require file i have tables and texts) ? i think it need button :/ please help. Rainulf yes i need if isset $_POST['submit'] OR isGeorgianIp $_SERVER['REMOTE_ADDR'] == true than show georgian table, but , if georgian people need also to view english table now what can i do i think i need 2 button and the main default file english. how to do this please help thanks
You don't - the code says that if you have a Georgian IP address you get the Georgian file. Computers can't read minds. If you tell the computer to show Georgian IPs only the Georgian file, that's what it does. If you want that to be the default, but allow the user to choose, put buttons on the site to select the file, then redirect based on a click.