• 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:

    https://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)
  • 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

    (@alexmoba)

    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.