Title: PHP insert error
Last modified: August 31, 2016

---

# PHP insert error

 *  [killix](https://wordpress.org/support/users/killix/)
 * (@killix)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-insert-error/)
 * 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/](https://wordpress.org/plugins/insert-php/)

Viewing 1 replies (of 1 total)

 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/php-insert-error/#post-7081952)
 * The print statement is malformed. There are unescaped quotes within quotes.
 * Try putting your code into a stand-alone PHP page and test it before putting 
   it into your post for Insert PHP to process. You’ll probably get less confusing
   error messages.
 * More about error messages
 * [http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#errormessages](http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#errormessages)
 * Will

Viewing 1 replies (of 1 total)

The topic ‘PHP insert error’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/php-insert-error/#post-7081952)
 * Status: not resolved