Title: Parse error @ header template when adding my own php-code!
Last modified: August 18, 2016

---

# Parse error @ header template when adding my own php-code!

 *  [martenbjork](https://wordpress.org/support/users/martenbjork/)
 * (@martenbjork)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/parse-error-header-template-when-adding-my-own-php-code/)
 * Hello!
    Im currently running wp 1.5 and the classic theme. Now, in the header
   i wanna insert the following script;
 * <?php
    Â  if(!isset($_COOKIE[“din_kana”])) { Â  echo ‘<img src=”images/new.jpg”
   >’; Â  setcookie(“din_kana”, TRUE, time()+3600); } else { Â  echo ‘<img src=”
   images/visited.jpg”>’; } Â  ?>
 * As you may understand, i want to show the users one image first time they enter,
   and then show’em another later. But all i get is:
 * Parse error: parse error, unexpected T_IF in /customers/gosse.se/gosse.se/httpd.
   www/artikel/wp-content/themes/classic/header.php on line 29
 * Can anybody help out please?
 * Thanks
    mÃ¥rten, sweden

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [smallangel](https://wordpress.org/support/users/smallangel/)
 * (@smallangel)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/parse-error-header-template-when-adding-my-own-php-code/#post-167719)
 * I am also getting this error :
    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING
   in /home/reclaimy/public_html/wp-content/themes/global/sidebar.php on line After
   I added a link to my sidebar. I deleted link and still nothing, can’t figure 
   out what I did wrong.
 *  [Java](https://wordpress.org/support/users/java/)
 * (@java)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/parse-error-header-template-when-adding-my-own-php-code/#post-167721)
 * Try inserting your code after the php header string. Whats the address to your
   website? What file are you trying to insert the code in? In your index or header
   file?
 *  [smallangel](https://wordpress.org/support/users/smallangel/)
 * (@smallangel)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/parse-error-header-template-when-adding-my-own-php-code/#post-167735)
 * Oh, I actually just fixed mine-I was just missing a (
    Thx -Sarah

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Parse error @ header template when adding my own php-code!’ is closed
to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [smallangel](https://wordpress.org/support/users/smallangel/)
 * Last activity: [21 years, 3 months ago](https://wordpress.org/support/topic/parse-error-header-template-when-adding-my-own-php-code/#post-167735)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
