Title: PHP If / Else Statement
Last modified: August 19, 2016

---

# PHP If / Else Statement

 *  [rnmproductions](https://wordpress.org/support/users/rnmproductions/)
 * (@rnmproductions)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-if-else-statement/)
 * What I’m trying to do is put an advertising script into my header but I want 
   select users to not be subject to the script. The only way I could think of doing
   this would be using an “If/Else Statement” but I’m very new to php and haven’t
   gotten it to work.
 * This is what I have so far…
 * <?php
    if ($user == ‘Admin’) { echo ”; } else { echo ‘<script type=”text/javascript”
   src=”[http://www.thatsprime.com/Webservices/jsParseLinks.aspx?id=05bf2f98″></script>&#8217](http://www.thatsprime.com/Webservices/jsParseLinks.aspx?id=05bf2f98″></script>&#8217);;}//
   end if
 * Anyone know what is wrong/what I could do to fix this?

Viewing 1 replies (of 1 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/php-if-else-statement/#post-1133954)
 * Try:
 * `<?php if (!is_user_logged_in()) echo '<script type="text/javascript" src="http://
   www.thatsprime.com/Webservices/jsParseLinks.aspx?id=05bf2f98"></script>';?>`

Viewing 1 replies (of 1 total)

The topic ‘PHP If / Else Statement’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/php-if-else-statement/#post-1133954)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
