Title: Chdir problem
Last modified: August 18, 2016

---

# Chdir problem

 *  [zxb2](https://wordpress.org/support/users/zxb2/)
 * (@zxb2)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/chdir-problem/)
 * I use this code to include some vBulletin files in my post.php
 * chdir(‘../forums/’);
    require_once(‘global.php’); require_once(‘includes/functions_newpost.
   php’);
 * chdir(‘../wp-admin/’);
    require_once(‘admin.php’);
 * But after editing a post it does not redirect back to the WordPress admin page,
   it just goes to a blank page. The post is still edited, but again, redirection
   is broken.
 * Also, the code works fine on my local server running PHP5. This server is running
   PHP4 however. I really don’t see why that’d make a difference in this case though…

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

 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/chdir-problem/#post-601814)
 * `chdir('../forums/');`
 * thats unnecessary, if you use the proper path to the file(s) you want to include.
 * `require_once('../forums/bleh.php');`
 *  Thread Starter [zxb2](https://wordpress.org/support/users/zxb2/)
 * (@zxb2)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/chdir-problem/#post-601845)
 * Cheers, got it working now. Chdir wasn’t the problem for some reason functions_newpost.
   php from vBulletin was conflicting with WordPress. I just copied one of the functions
   I needed from the file into post.php and it works fine.
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/chdir-problem/#post-601846)
 * Cool, happy to hear that. ffr, I wasnt suggesting that your usage of that was
   a problem, just pointing out that it’s not needed.

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

The topic ‘Chdir problem’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 2 participants
 * Last reply from: [whooami](https://wordpress.org/support/users/whooami/)
 * Last activity: [18 years, 8 months ago](https://wordpress.org/support/topic/chdir-problem/#post-601846)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
