• Hey i build this to give my users a better experiance on my website by linking to external websites of there country:

    $ip = $_SERVER['REMOTE_ADDR'];
    $country = trim(file_get_contents("http://ipinfo.io/{$ip}/country"));
    if($country == "GB") print "<a href="http://www.amazon.co.uk"</a>";
    if($country == "DE") print "<a href="http://www.amazon.de"</a>";
    if($country == "ES") print "<a href="http://www.amazon.es"</a>";
    if($country == "FR") print "<a href="http://www.amazon.fr"</a>";
    if($country == "IT") print "<a href="http://www.amazon.it"</a>";
    if($country == "US") print "<a href="http://www.amazon.com"</a>";

    The error i am receiving is below:

    Parse error: syntax error, unexpected ‘http’ (T_STRING) in /home/USERNAME/public_html/wp-content/plugins/insert-php/insert_php.php(48) : eval()’d code on line 5

    Do you know what may be causing this?

    Thanks a ton.
    Lucas.

    https://wordpress.org/plugins/insert-php/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘PHP insert error’ is closed to new replies.