Title: PHP if statement problem
Last modified: August 20, 2016

---

# PHP if statement problem

 *  [agnkol](https://wordpress.org/support/users/agnkol/)
 * (@agnkol)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/php-if-statement-problem/)
 * Could somebody help me please?
    The following code crushes down my webpage:
 * <?php if($_SERVER[‘QUERY_STRING’]==”page_id=15″)||($_SERVER[‘QUERY_STRING’]==”
   page_id=12″) : ?>
    - [Wieliczka](https://wordpress.org/support/topic/php-if-statement-problem/?page_id=24)
    - [Niepołomice](https://wordpress.org/support/topic/php-if-statement-problem/?page_id=25)
    - [Gdów](https://wordpress.org/support/topic/php-if-statement-problem/?page_id=26)
 * <?php endif; ?>
 * I’ve tried many combinations and nothing works 🙁
    Any suggestions?

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

 *  Thread Starter [agnkol](https://wordpress.org/support/users/agnkol/)
 * (@agnkol)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/php-if-statement-problem/#post-2236387)
 *     ```
       <?php if($_SERVER['QUERY_STRING']=="page_id=15")||($_SERVER['QUERY_STRING']=="page_id=12") : ?> 
   
        	<ul>
               		<li><a href="?page_id=24">Wieliczka</a></li>
       			<li><a href="?page_id=25">Niepołomice</a></li>
       			<li><a href="?page_id=26">Gdów</a></li>
       	</ul>
       <?php endif; ?>
       ```
   
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/php-if-statement-problem/#post-2236429)
 * > crushes down my webpage
 * any error message?
 * try to add some brackets around the if:
 *     ```
       <?php if(($_SERVER['QUERY_STRING']=="page_id=15")||($_SERVER['QUERY_STRING']=="page_id=12")) : ?>
       ```
   

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

The topic ‘PHP if statement problem’ is closed to new replies.

## Tags

 * [if](https://wordpress.org/support/topic-tag/if/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/php-if-statement-problem/#post-2236429)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
