I dont know if this will change anything but give it a try

<? // UR CODe
//print("$bildfil");
if (isset($bildfil) )
{
print("<img src=\"$bildfil\" height=\"60\" width=\"60\" alt=\"image\">");

}
else
{
print("no picture to show");
}
?>

and #2 is in ur image tag I believe u need th actual server location of where the file is put not where it was on the users computer which is what I think is being held in $bildfil, But I could be totaly off base ... maybe posting some more of the code in these scripts will help us.

    the isset command doesn't change anything. I actually trying to show the picture, but no picture is shown. The if-else part is correct.

    Like I wrote earlier the $bildfil variable contain place on the server I guess /tmp/...something.
    It is not the url on the users computer.
    I don't think I have to store the picture in a folder first. I just want to pass it to another page from the HTML form and show it.

    I have no idea why it doesn't work.

    You asked for more code but it is basically all, that I showed you.

      From what you Posted $bildfile is location before the image is moved by whatever script moves it ... unless u change that value in the process. If you dont change the value to where the picture actually resides u wont see the image... not sure how u want to do it ... but when I did something similiar I stored the image location in a database and pulled the location when displaying the image ... My apologies if that isnt any help or if I am totaly off in another rhelm of php 🙂

        ok, I'm very new to this stuff, so I'm not sure about my answer, but I think that what you have in $bildfil is an array of file information.
        The actual name of your file/path is given by $bildfil['name'] (I think, not sure about the array format).

        I've been printing images on-screen and using something like,

        <img src="<?php echo $_FILES['userfile']['name'] ?>" >

        You find mention of the other file array information in that link given by jimson.

        If you play about with $_FILES['userfile']['name'] thing, that might get it.

          still no picture is shown. The Variable _FILES['bildfil']['name'] contains:

          /tmp/php3jowvF

          I try to show the picture with:

          php

          $bildfil=$_FILES['bildfil']['name'];
          print("<img src=\"$bildfil\" height=\"60\" width=\"60\" alt=\"image\">");

          All I get is a empy frame, but no picture in the frame. Is the code above right?

            do you have a /tmp directory in the root web folder? If your /tmp directory is located elsewhere, then you can't access it through that URL. Remember that /tmp/filename is trying to access the file http://www.yourserver.com/tmp/filename. So check your server and verify that that directory does exist in the right place, and that the file is indeed in that directory.

              You were right. My webspace provider don't give me a folder like that in my root. So basically I can't have a picture loaded in a HTML form and then show it on the next page?

              Is there a solution to that?
              I know that my provider doeasn't change anything on the server.

              /Martin

                You'll probably need to discuss that with your provider. If you explain to them what you are trying to do, I'm sure they can either tell you "no" or let you know what you need to do to make it work.

                  They said that they don't do any changes on the server. So I'm stuck and there is nothing to do it seems. There should be some other way.....?

                  Thanks for the help anyway.

                    I have a script that upload the picture to the database and it works, so I could use that...upload the picture and then download it and show it, but it seems like a stupid thing thing to do! Or?

                      if register_globals = On

                      your actual pic would be

                      $actualfilename = $bildfile_name;

                        by uploadin, php puts the image into the tmp directory where it remains till the script ends. So to save your image data, u MUST use move_uploaded_file() in order to move the temporary file to some directory, i.e. your webpages graphics directory... use something like this:

                        <?php
                        // In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES.
                        // In PHP earlier then 4.0.3, use copy() and is_uploaded_file() instead of move_uploaded_file
                        
                        $uploaddir = '/var/www/uploads/';
                        
                        print "<pre>";
                        if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir . $_FILES['userfile']['name'])) {
                            print "File is valid, and was successfully uploaded.  debugging info:\n";
                            print_r($_FILES);
                        } else {
                            print "Possible file upload attack!  debugging info:\n";
                            print_r($_FILES);
                        }
                        ?>

                        (this is from http://de2.php.net/manual/en/features.file-upload.php), so check out this manual page, there's everything u need.
                        However, the code given above should work when u set $uploaddir to the path where u wanna store your images.
                        hth

                          Write a Reply...