Title: Run php script from theme backend
Last modified: August 19, 2016

---

# Run php script from theme backend

 *  [alexmoba](https://wordpress.org/support/users/alexmoba/)
 * (@alexmoba)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/run-php-script-from-theme-backend/)
 * Hello, I’m currently developing a theme witch has a rather powerful backend, 
   I created a php image upload box that runs perfectly if accessed by the direct
   url, example:
 * [http://www.example.com/wp-content/themes/example-theme/library/functions/image-upload.php](http://www.example.com/wp-content/themes/example-theme/library/functions/image-upload.php)
 * However I want to integrate the form in image-upload.php to my theme backend,
   naturally my first attempt was to use a simple include:
 * `<?php include ('image-upload.php'); ?>`
 * And the form did get embedded in my theme backend but it just doesn’t work, it
   does not upload an image to my server, however by accessing the image-upload.
   php directly by url it does work (as mentioned above).
 * Does anyone have an idea why this happens?

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

 *  [dagon-design](https://wordpress.org/support/users/dagon-design/)
 * (@dagon-design)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/run-php-script-from-theme-backend/#post-1163353)
 * Does it act like it is going to upload, but stop? Does it give an error?
 * Perhaps it is giving an error/warning, but not showing it. You could add this
   to the top of the file:
 * `error_reporting(E_ALL);`
 *  Thread Starter [alexmoba](https://wordpress.org/support/users/alexmoba/)
 * (@alexmoba)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/run-php-script-from-theme-backend/#post-1163369)
 * I tried the error_reporting function however there doesn’t seem to be any problems
   with hidden errors.
 * As an alternative I’ve just added a link to the direct php script inside the 
   theme backend and it works just fine, the problem is when I included the form
   in the backend.
 * Although they’re both on the same folder I have a feeling the relative paths 
   are different when including the php script and when accessing it directly.

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

The topic ‘Run php script from theme backend’ is closed to new replies.

## Tags

 * [Backend](https://wordpress.org/support/topic-tag/backend/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [script](https://wordpress.org/support/topic-tag/script/)
 * [upload](https://wordpress.org/support/topic-tag/upload/)

 * 2 replies
 * 2 participants
 * Last reply from: [alexmoba](https://wordpress.org/support/users/alexmoba/)
 * Last activity: [16 years, 10 months ago](https://wordpress.org/support/topic/run-php-script-from-theme-backend/#post-1163369)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
