Image storing issues / File handling

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pescott

    #1

    Image storing issues / File handling

    I am still struggling to get some files uploaded to a database as BLOB
    data. I have 5 includes which allows the user to upload 5 files,
    numbered accordingly. However, there are script errors. Duhh, why else
    would I post? Well, here goes:

    CODE
    $adres = trim (htmlspecialcha rs($_POST["adres"]));
    $verkocht = trim (htmlspecialcha rs($_POST["verkocht"]));
    $form_descripti on1 = trim
    (htmlspecialcha rs($_POST["form_descripti on1"]));
    $form_descripti on2 = trim
    (htmlspecialcha rs($_POST["form_descripti on2"]));
    $form_descripti on3 = trim
    (htmlspecialcha rs($_POST["form_descripti on3"]));
    $form_descripti on4 = trim
    (htmlspecialcha rs($_POST["form_descripti on4"]));
    $form_descripti on5 = trim
    (htmlspecialcha rs($_POST["form_descripti on5"]));

    // store the file information to variables for easier access 1
    $tmp_name1 = $_FILES['form_data1']['tmp_name'];
    $type1 = $_FILES['form_data1']['type'];
    $name1 = $_FILES['form_data1']['name'];
    $size1 = $_FILES['form_data1']['size'];

    // store the file information to variables for easier access 2
    $tmp_name2 = $_FILES['form_data2']['tmp_name'];
    $type2 = $_FILES['form_data2']['type'];
    $name2 = $_FILES['form_data2']['name'];
    $size2 = $_FILES['form_data2']['size'];

    // store the file information to variables for easier access 3
    $tmp_name3 = $_FILES['form_data3']['tmp_name'];
    $type3 = $_FILES['form_data3']['type'];
    $name3 = $_FILES['form_data3']['name'];
    $size3 = $_FILES['form_data3']['size'];

    // store the file information to variables for easier access 4
    $tmp_name4 = $_FILES['form_data4']['tmp_name'];
    $type4 = $_FILES['form_data4']['type'];
    $name4 = $_FILES['form_data4']['name'];
    $size4 = $_FILES['form_data4']['size'];

    // store the file information to variables for easier access 5
    $tmp_name5 = $_FILES['form_data5']['tmp_name'];
    $type5 = $_FILES['form_data5']['type'];
    $name5 = $_FILES['form_data5']['name'];
    $size5 = $_FILES['form_data5']['size'];

    // if the upload succeeded, the file will exist
    if (file_exists($t mp_name1) && file_exists($tm p_name2) &&
    file_exists($tm p_name3) && file_exists($tm p_name4) &&
    file_exists($tm p_name5)) {

    // check to make sure that it is an uploaded file and not a system file
    if (is_uploaded_fi le($tmp_name1) && is_uploaded_fil e($tmp_name2) &&
    is_uploaded_fil e($tmp_name3) && is_uploaded_fil e($tmp_name4) &&
    is_uploaded_fil e($tmp_name5)) {

    // open the file for a binary read
    $file1 = fopen($tmp_name 1,'rb');
    $file2 = fopen($tmp_name 2,'rb');
    $file3 = fopen($tmp_name 3,'rb');
    $file4 = fopen($tmp_name 4,'rb');
    $file5 = fopen($tmp_name 5,'rb');

    // read the file content into a variable
    $data1 = fread($file1,fi lesize($tmp_nam e1));
    $data2 = fread($file2,fi lesize($tmp_nam e2));
    $data3 = fread($file3,fi lesize($tmp_nam e3));
    $data4 = fread($file4,fi lesize($tmp_nam e4));
    $data5 = fread($file5,fi lesize($tmp_nam e5));

    // close the file
    fclose($file1) && fclose ($file2) && fclose($file3) && fclose ($file4)
    && fclose ($file5);

    // now we encode it and split it into acceptable length lines
    $data1 = chunk_split(bas e64_encode($dat a1));
    $data2 = chunk_split(bas e64_encode($dat a2));
    $data3 = chunk_split(bas e64_encode($dat a3));
    $data4 = chunk_split(bas e64_encode($dat a4));
    $data5 = chunk_split(bas e64_encode($dat a5));
    }
    else {
    print("<br><b>I s this thing working? At all?</b><br>\n");
    }
    }
    else {
    print("<br><b>N ope, not yet...</b><br>\n");
    }

    $query = "INSERT into $Tabelnaam (adres,verkocht ,
    description1,bi n_data1,filenam e1,filesize1,fi letype1,
    description2,bi n_data2,filenam e2,filesize2,fi letype2,
    description3,bi n_data3,filenam e3,filesize3,fi letype3,
    description4,bi n_data4,filenam e4,filesize4,fi letype4,
    description5,bi n_data5,filenam e5,filesize5,fi letype5)
    values
    ('$adres', '$verkocht',
    '$form_descript ion1', '$data1', '$name1', '$size1', '$type1',
    '$form_descript ion2', '$data2', '$name2', '$size2', '$type2',
    '$form_descript ion3', '$data3', '$name3', '$size3', '$type3',
    '$form_descript ion4', '$data4', '$name4', '$size4', '$type4',
    '$form_descript ion5', '$data5', '$name5', '$size5', '$type5')";
    $Opdracht = mysql_query($qu ery) or die(mysql_error ());

    print ("De opdracht is:<br />$Opdracht<P>\n ");

    if(mysql_affect ed_rows($Verbin ding) == 1)
    {
    print ("De opdracht is met succes uitgevoerd!<br> \n");
    }
    else
    {
    print ("De opdracht kon niet worden uitgevoerd!<br> \n");
    }
    mysql_close ($Verbinding);


    And this is the returned error:


    QUOTE
    Nope, not yet...
    De opdracht is:
    1
    De opdracht is met succes uitgevoerd!


    What's wrong with checking if the file exists, because that is where
    the error message seems to come from...

  • Daniel Tryba

    #2
    Re: Image storing issues / File handling

    pescott <google@pescott .com> wrote:[color=blue]
    > I am still struggling to get some files uploaded to a database as BLOB
    > data. I have 5 includes which allows the user to upload 5 files,
    > numbered accordingly. However, there are script errors. Duhh, why else
    > would I post? Well, here goes:[/color]

    Why not start with 1 file first?

    [snip][color=blue]
    > // if the upload succeeded, the file will exist
    > if (file_exists($t mp_name1) && file_exists($tm p_name2) &&
    > file_exists($tm p_name3) && file_exists($tm p_name4) &&
    > file_exists($tm p_name5)) {[/color]
    [snip][color=blue]
    > What's wrong with checking if the file exists, because that is where
    > the error message seems to come from...[/color]

    You do know what that line of code represents? It appears the condition
    isn't true, how do you know that it indeed should be true?

    Comment

    • pescott

      #3
      Re: Image storing issues / File handling

      Yes I understand. The problem I have, even when trying to upload one
      file, taht it does not seem to ne opened, but for the life of me, I
      cannot figure out why that is. Unless of course I am missing vital
      informattion in this handlescript...
      So the error I get indeed suggests that file_exist() is false, for one
      or all of the files. But browsing the file and passing it on to the
      handlescript, including a file description, return an empty field in
      the db where the data should be stored, but the description makes it
      in. None of the other info does, however, i.e. name, size, type, and
      binary data. So what am I missing here?

      Comment

      • Andy Hassall

        #4
        Re: Image storing issues / File handling

        On 25 Apr 2005 07:35:45 -0700, "pescott" <google@pescott .com> wrote:
        [color=blue]
        >Yes I understand. The problem I have, even when trying to upload one
        >file, taht it does not seem to ne opened, but for the life of me, I
        >cannot figure out why that is. Unless of course I am missing vital
        >informattion in this handlescript...
        >So the error I get indeed suggests that file_exist() is false, for one
        >or all of the files. But browsing the file and passing it on to the
        >handlescript , including a file description, return an empty field in
        >the db where the data should be stored, but the description makes it
        >in. None of the other info does, however, i.e. name, size, type, and
        >binary data. So what am I missing here?[/color]

        When you don't know what you're missing, there's a couple of things to try
        first before taking the code apart too much: start printing things out, or
        simplify.

        You could print out the $_FILES array, this is likely to give various bits of
        information.

        print "<pre>";
        var_dump($_FILE S); // or even: print_r($_FILES ); - depends which you find more
        readable.
        print "</pre>";

        If that doesn't help, print out more variables.

        To simplify, you could cut it down to just one file instead of five.

        You are uploading all five files when you test it, right? Since that's what
        you've got a condition for.

        --
        Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
        <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

        Comment

        • pescott

          #5
          Re: Image storing issues / File handling

          The answer to the dump command is:

          array(0),

          so I gather that nothing makes is to the handling page. Does that mean
          teh problem is located elsewhere? I don't know how to fix this thing...

          Comment

          • Norman Peelman

            #6
            Re: Image storing issues / File handling

            "Andy Hassall" <andy@andyh.co. uk> wrote in message
            news:4kgq61dkrq ev4dpgrua1fc6vj 8g2gaqaj1@4ax.c om...[color=blue]
            > On 25 Apr 2005 07:35:45 -0700, "pescott" <google@pescott .com> wrote:
            >[color=green]
            > >Yes I understand. The problem I have, even when trying to upload one
            > >file, taht it does not seem to ne opened, but for the life of me, I
            > >cannot figure out why that is. Unless of course I am missing vital
            > >informattion in this handlescript...
            > >So the error I get indeed suggests that file_exist() is false, for one
            > >or all of the files. But browsing the file and passing it on to the
            > >handlescript , including a file description, return an empty field in
            > >the db where the data should be stored, but the description makes it
            > >in. None of the other info does, however, i.e. name, size, type, and
            > >binary data. So what am I missing here?[/color]
            >
            > When you don't know what you're missing, there's a couple of things to[/color]
            try[color=blue]
            > first before taking the code apart too much: start printing things out, or
            > simplify.
            >
            > You could print out the $_FILES array, this is likely to give various[/color]
            bits of[color=blue]
            > information.
            >
            > print "<pre>";
            > var_dump($_FILE S); // or even: print_r($_FILES ); - depends which you find[/color]
            more[color=blue]
            > readable.
            > print "</pre>";
            >
            > If that doesn't help, print out more variables.
            >
            > To simplify, you could cut it down to just one file instead of five.
            >
            > You are uploading all five files when you test it, right? Since that's[/color]
            what[color=blue]
            > you've got a condition for.
            >
            > --
            > Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
            > <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool[/color]

            You will never be able to check for the files in that manner - you are
            assuming that 5 files will be uploaded every time... try using a loop
            instead

            for ($loop = 1; $loop <= 5; $loop++)
            {

            if (isset($_FILES["form_data$loop "]) &&
            file_exists($_F ILES["form_data$loop "]) &&
            is_uploaded_fil e($_FILES["form_data$loop "]))
            {
            ${form_descript ion$loop} =
            trim(htmlspecia lchars($_POST["form_descripti on$loop"]));

            ${tmpname$loop} = $_FILES["form_data$loop "]['tmp_name']);
            ${type$loop} = $_FILES["form_data$loop "]['type']);
            ${name$loop} = $_FILES["form_data$loop "]['name']);
            ${size$loop} = $_FILES["form_data$loop "]['size']);

            ${file$loop} = fopen(${tmpname $loop},'rb');
            ${data$loop} = fread(${file$lo op},filesize(${ tmpname$loop})) ;
            fclose(${file$l oop});
            ${data$loop} = chunk_split(bas e64_encode(${da ta$loop}));
            }
            else
            {
            ${form_descript ion$loop} = 'no description';
            ${tmpname$loop} = 'no file';
            ${type$loop} = 'no type';
            ${name$loop} = 'no name';
            ${size$loop} = '0';
            }
            }

            $query = "INSERT into $Tabelnaam (adres,verkocht ,
            description1,bi n_data1,filenam e1,filesize1,fi letype1,
            description2,bi n_data2,filenam e2,filesize2,fi letype2,
            description3,bi n_data3,filenam e3,filesize3,fi letype3,
            description4,bi n_data4,filenam e4,filesize4,fi letype4,
            description5,bi n_data5,filenam e5,filesize5,fi letype5)
            values
            ('$adres', '$verkocht',
            '$form_descript ion1', '$data1', '$name1', '$size1', '$type1',
            '$form_descript ion2', '$data2', '$name2', '$size2', '$type2',
            '$form_descript ion3', '$data3', '$name3', '$size3', '$type3',
            '$form_descript ion4', '$data4', '$name4', '$size4', '$type4',
            '$form_descript ion5', '$data5', '$name5', '$size5', '$type5')";

            $Opdracht = mysql_query($qu ery) or die(mysql_error ());

            ---

            ....untested... but should work... I love dynamic variables! ;)

            Norm
            ---
            FREE Avatar Hosting at www.easyavatar.com



            Comment

            • pescott

              #7
              Re: Image storing issues / File handling

              <?php
              /* Dit script ontvangt en verwerkt de door "xcheckaanbod.p hp"
              gegenereerde gegevens. */

              // Stel hier de variabelen voor de toegang tot de database in:
              $Host = "localhost" ;
              $Gebruiker = "";
              $Wachtwoord = "";
              $DBNaam = "";
              $Tabelnaam = "aanbod";

              $Verbinding = mysql_connect ($Host, $Gebruiker, $Wachtwoord) or die("Er
              kon geen verbinding worden gemaakt met de database");

              // select database
              mysql_select_db ("$DBNaam");

              // Snijd de binnekomende gegevens bij.
              $adres = trim (htmlspecialcha rs($_POST["adres"]));
              $postcode = trim (htmlspecialcha rs($_POST["postcode"]));
              $stad = trim (htmlspecialcha rs($_POST["stad"]));
              $wijk = trim (htmlspecialcha rs($_POST["wijk"]));
              $vraagprijs = trim (htmlspecialcha rs($_POST["vraagprijs "]));
              $type = trim (htmlspecialcha rs($_POST["type"]));
              $oppervlakte = trim (htmlspecialcha rs($_POST["oppervlakt e"]));
              $perceel = trim (htmlspecialcha rs($_POST["perceel"]));
              $inhoud = trim (htmlspecialcha rs($_POST["inhoud"]));
              $kamers = trim (htmlspecialcha rs($_POST["kamers"]));
              $omschrijving = trim (htmlspecialcha rs($_POST["omschrijvi ng"]));
              $bouwjaar = trim (htmlspecialcha rs($_POST["bouwjaar"]));
              $kenmerken = trim (htmlspecialcha rs($_POST["kenmerken"]));
              $balkon = trim (htmlspecialcha rs($_POST["balkon"]));
              $tuin = trim (htmlspecialcha rs($_POST["tuin"]));
              $garage = trim (htmlspecialcha rs($_POST["garage"]));
              $berging = trim (htmlspecialcha rs($_POST["berging"]));
              $verwarming = trim (htmlspecialcha rs($_POST["verwarming "]));
              $cv = trim (htmlspecialcha rs($_POST["cv"]));
              $soortcv = trim (htmlspecialcha rs($_POST["soortcv"]));
              $bouwjaarcv = trim (htmlspecialcha rs($_POST["bouwjaarcv "]));
              $isolatie = trim (htmlspecialcha rs($_POST["isolatie"]));
              $oplevering = trim (htmlspecialcha rs($_POST["oplevering "]));
              $verkocht = trim (htmlspecialcha rs($_POST["verkocht"]));
              $form_descripti on1 = trim
              (htmlspecialcha rs($_POST["form_descripti on1"]));
              $form_descripti on2 = trim
              (htmlspecialcha rs($_POST["form_descripti on2"]));
              $form_descripti on3 = trim
              (htmlspecialcha rs($_POST["form_descripti on3"]));
              $form_descripti on4 = trim
              (htmlspecialcha rs($_POST["form_descripti on4"]));
              $form_descripti on5 = trim
              (htmlspecialcha rs($_POST["form_descripti on5"]));

              for ($loop = 1; $loop <= 5; $loop++)
              {

              if (isset($_FILES["form_data$loop "]) &&
              file_exists($_F ILES["form_data$loop "]) &&
              is_uploaded_fil e($_FILES["form_data$loop "]))
              {
              ${form_descript ion$loop} =
              trim(htmlspecia lchars($_POST["form_descripti on$loop"]));

              ${tmpname$loop} = $_FILES["form_data$loop "]['tmpname']);
              ${type$loop} = $_FILES["form_data$loop "]['type']);
              ${name$loop} = $_FILES["form_data$loop "]['name']);
              ${size$loop} = $_FILES["form_data$loop "]['size']);

              ${file$loop} = fopen(${tmpname $loop},'rb');
              ${data$loop} = fread(${file$lo op},filesize(${ tmpname$loop})) ;
              fclose(${file$l oop});
              ${data$loop} = chunk_split(bas e64_encode(${da ta$loop}));
              }
              else
              {
              ${form_descript ion$loop} = 'no description';
              ${tmpname$loop} = 'no file';
              ${type$loop} = 'no type';
              ${name$loop} = 'no name';
              ${size$loop} = '0';
              }

              }

              $query = "INSERT into $Tabelnaam
              (adres,postcode ,stad,wijk,vraa gprijs,type,opp ervlakte,percee l,
              inhoud,kamers,o mschrijving,bou wjaar,kenmerken ,balkon,tuin,ga rage,
              berging,verwarm ing,cv,soortcv, bouwjaarcv,isol atie,oplevering ,verkocht,
              description1,bi n_data1,filenam e1,filesize1hei ght,
              filesize1width, filetype1,
              description2,bi n_data2,filenam e2,filesize2,fi letype2,
              description3,bi n_data3,filenam e3,filesize3,fi letype3,
              description4,bi n_data4,filenam e4,filesize4,fi letype4,
              description5,bi n_data5,filenam e5,filesize5,fi letype5)
              values
              ('$adres', '$postcode', '$stad', '$wijk', '$vraagprijs', '$type',
              '$oppervlakte', '$perceel',
              '$inhoud', '$kamers', '$omschrijving' , '$bouwjaar', '$kenmerken',
              '$balkon', '$tuin', '$garage',
              '$berging', '$verwarming', '$cv', '$soortcv', '$bouwjaarcv',
              '$isolatie', '$oplevering', '$verkocht',
              '$form_descript ion1', '$data1', '$name1', '".$size1[1]."',
              '".$size1[0]."', '$type1',
              '$form_descript ion2', '$data2', '$name2', '$size2', '$type2',
              '$form_descript ion3', '$data3', '$name3', '$size3', '$type3',
              '$form_descript ion4', '$data4', '$name4', '$size4', '$type4',
              '$form_descript ion5', '$data5', '$name5', '$size5', '$type5')";
              $Opdracht = mysql_query($qu ery) or die(mysql_error ());

              print ("De opdracht is:<br />$Opdracht<P>\n ");

              if(mysql_affect ed_rows($Verbin ding) == 1)
              {
              print ("De opdracht is met succes uitgevoerd!<br> \n");
              }
              else
              {
              print ("De opdracht kon niet worden uitgevoerd!<br> \n");
              }
              mysql_close ($Verbinding);
              ?>

              Using this code I now get a parse error on line 65 which is this line

              ${form_descript ion$loop} =
              trim(htmlspecia lchars($_POST["form_descripti on$loop"]));
              Am I supposed to cut the section which the trimming of the description
              out of the code? And I do not understand the loop very well... Thank
              you for your input!

              Comment

              • pescott

                #8
                Re: Image storing issues / File handling

                <?php

                $Host = "localhost" ;
                $Gebruiker = "";
                $Wachtwoord = "";
                $DBNaam = "";
                $Tabelnaam = "aanbod";

                $Verbinding = mysql_connect ($Host, $Gebruiker, $Wachtwoord) or die("Er
                kon geen verbinding worden gemaakt met de database");

                mysql_select_db ("$DBNaam");

                $adres = trim (htmlspecialcha rs($_POST["adres"]));
                $postcode = trim (htmlspecialcha rs($_POST["postcode"]));
                $stad = trim (htmlspecialcha rs($_POST["stad"]));
                $wijk = trim (htmlspecialcha rs($_POST["wijk"]));
                $vraagprijs = trim (htmlspecialcha rs($_POST["vraagprijs "]));
                $type = trim (htmlspecialcha rs($_POST["type"]));
                $oppervlakte = trim (htmlspecialcha rs($_POST["oppervlakt e"]));
                $perceel = trim (htmlspecialcha rs($_POST["perceel"]));
                $inhoud = trim (htmlspecialcha rs($_POST["inhoud"]));
                $kamers = trim (htmlspecialcha rs($_POST["kamers"]));
                $omschrijving = trim (htmlspecialcha rs($_POST["omschrijvi ng"]));
                $bouwjaar = trim (htmlspecialcha rs($_POST["bouwjaar"]));
                $kenmerken = trim (htmlspecialcha rs($_POST["kenmerken"]));
                $balkon = trim (htmlspecialcha rs($_POST["balkon"]));
                $tuin = trim (htmlspecialcha rs($_POST["tuin"]));
                $garage = trim (htmlspecialcha rs($_POST["garage"]));
                $berging = trim (htmlspecialcha rs($_POST["berging"]));
                $verwarming = trim (htmlspecialcha rs($_POST["verwarming "]));
                $cv = trim (htmlspecialcha rs($_POST["cv"]));
                $soortcv = trim (htmlspecialcha rs($_POST["soortcv"]));
                $bouwjaarcv = trim (htmlspecialcha rs($_POST["bouwjaarcv "]));
                $isolatie = trim (htmlspecialcha rs($_POST["isolatie"]));
                $oplevering = trim (htmlspecialcha rs($_POST["oplevering "]));
                $verkocht = trim (htmlspecialcha rs($_POST["verkocht"]));
                $form_descripti on1 = trim
                (htmlspecialcha rs($_POST["form_descripti on1"]));
                $form_descripti on2 = trim
                (htmlspecialcha rs($_POST["form_descripti on2"]));
                $form_descripti on3 = trim
                (htmlspecialcha rs($_POST["form_descripti on3"]));
                $form_descripti on4 = trim
                (htmlspecialcha rs($_POST["form_descripti on4"]));
                $form_descripti on5 = trim
                (htmlspecialcha rs($_POST["form_descripti on5"]));

                for ($loop = 1; $loop <= 5; $loop++)
                {

                if (isset($_FILES["form_data$loop "]) &&
                file_exists($_F ILES["form_data$loop "]) &&
                is_uploaded_fil e($_FILES["form_data$loop "]))
                {
                ${form_descript ion$loop} =
                trim(htmlspecia lchars($_POST["form_descripti on$loop"]));

                ${tmpname$loop} = $_FILES["form_data$loop "]['tmpname']);
                ${type$loop} = $_FILES["form_data$loop "]['type']);
                ${name$loop} = $_FILES["form_data$loop "]['name']);
                ${size$loop} = $_FILES["form_data$loop "]['size']);

                ${file$loop} = fopen(${tmpname $loop},'rb');
                ${data$loop} = fread(${file$lo op},filesize(${ tmpname$loop})) ;
                fclose(${file$l oop});
                ${data$loop} = chunk_split(bas e64_encode(${da ta$loop}));
                }
                else
                {
                ${form_descript ion$loop} = 'no description';
                ${tmpname$loop} = 'no file';
                ${type$loop} = 'no type';
                ${name$loop} = 'no name';
                ${size$loop} = '0';
                }

                }

                $query = "INSERT into $Tabelnaam
                (adres,postcode ,stad,wijk,vraa gprijs,type,opp ervlakte,percee l,
                inhoud,kamers,o mschrijving,bou wjaar,kenmerken ,balkon,tuin,ga rage,
                berging,verwarm ing,cv,soortcv, bouwjaarcv,isol atie,oplevering ,verkocht,
                description1,bi n_data1,filenam e1,filesize1,fi letype1,
                description2,bi n_data2,filenam e2,filesize2,fi letype2,
                description3,bi n_data3,filenam e3,filesize3,fi letype3,
                description4,bi n_data4,filenam e4,filesize4,fi letype4,
                description5,bi n_data5,filenam e5,filesize5,fi letype5)
                values
                ('$adres', '$postcode', '$stad', '$wijk', '$vraagprijs', '$type',
                '$oppervlakte', '$perceel', '$inhoud', '$kamers', '$omschrijving' ,
                '$bouwjaar', '$kenmerken', '$balkon', '$tuin', '$garage', '$berging',
                '$verwarming', '$cv', '$soortcv', '$bouwjaarcv', '$isolatie',
                '$oplevering', '$verkocht',
                '$form_descript ion1', '$data1', '$name1', '$size1', '$type1',
                '$form_descript ion2', '$data2', '$name2', '$size2', '$type2',
                '$form_descript ion3', '$data3', '$name3', '$size3', '$type3',
                '$form_descript ion4', '$data4', '$name4', '$size4', '$type4',
                '$form_descript ion5', '$data5', '$name5', '$size5', '$type5')";
                $Opdracht = mysql_query($qu ery) or die(mysql_error ());

                print ("De opdracht is:<br />$Opdracht<P>\n ");

                if(mysql_affect ed_rows($Verbin ding) == 1)
                {
                print ("De opdracht is met succes uitgevoerd!<br> \n");
                }
                else
                {
                print ("De opdracht kon niet worden uitgevoerd!<br> \n");
                }
                mysql_close ($Verbinding);
                ?>


                Using this code I now get a parse error on line 65 which is this line

                ${form_descript ion$loop} =
                trim(htmlspecia lchars($_POST["­form_descript ion$loop"]));
                Am I supposed to cut the section which the trimming of the description
                out of the code? And I do not understand the loop very well... Thank
                you for your input!

                Comment

                Working...