Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with include

    I have a function that is inside a file called image_work.php, i include it at the top of my file and then inside this:

    PHP Code:
    include('image_work.php');
    if(
    $action == "home") {
         if(
    $_FILES['imagefile']) {
            
    handleUpload($_FILES['imagefile'], "thebandits");
         }

    anyone know why the include isn't working? the script keeps dying right at the second if statement and i can't figure out why

  • #2
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Are you sure its not being included? Do you see any errors stating otherwise? Try using require() to test whether or not its being included. Have you checked your include path in your ini? Are you sure the file input's name is 'imagefile'?
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,049
    Thanks
    2
    Thanked 317 Times in 309 Posts
    Define - "the script keeps dying" You need to specifically tell us what it is or is not doing. We only see the information that you post and if it is vague, you will only get vague answers. Are there any errors? If the "if" conditional test is always false and does not execute the function call inside it, you need to state that.

    I suspect that checking your web server log for errors and/or putting the following two lines in after your first opening <?php tag will point to why it is not working -
    PHP Code:
    ini_set ("display_errors""1");
    error_reporting(E_ALL); 
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •