Parse Error with Uploadaction.php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Dween Bean
    Staff Sergeant

    • May 2006
    • 46

    Parse Error with Uploadaction.php

    Hi:
    I was testing my upload form page: <http://www.epgusa.com/uploadform.html>
    and received the following error message:

    Parse error: syntax error, unexpected ':' in /home2/epguacom/public_html/uploadaction.php on line 35
    My php code is below. What needs to be changed?
    I await your response.
    Dween Bean

    <?php

    // Receiving variables

    @$email = addslashes($_POST['email']);
    @$upload_Name = $_FILES['upload']['name'];
    @$upload_Size = $_FILES['upload']['size'];
    @$upload_Temp = $_FILES['upload']['tmp_name'];


    // Validation for max file size

    if ($upload_Size>0)
    {
    if( $upload_Size >20000000)
    {
    //delete file
    unlink($upload_Temp);
    header("Location: error.html");
    exit;
    }
    $uploadFile = "uploads/".$upload_Name ;

    @move_uploaded_file( $upload_Temp , $uploadFile);
    chmod($uploadFile, 0644);
    $upload_URL = "http://www.epgusa.com/uploads/".$upload_Name ;
    }

    //Sending Email to form owner

    $mailto = "youremail@yourdomain.com";
    $mailsubj = "Your Uploaded Photo/s";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Thank you for uploading your photo/s to Electric Paintbrush Gallery":\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS))
    {
    if ($key!="submit")
    {
    $mailbody .= "$key : $val\n";
    }
    }
    $mailbody .= "upload: $upload_URL\n";
    mail($mailto, $mailsubj, $mailbody, $mailhead);

    header("Location: thankyou_page.html");

    ?>
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Parse Error with Uploadaction.php

    $mailbody = "Thank you for uploading your photo/s to Electric Paintbrush Gallery:\n";

    Delete the " after the word Gallery

    However, i beleive you have errors in your form:

    1.Three (?) submit buttons, one for each pic plus a general one. But it's only one form, so, any of the three will submit ALL fields. The "Upload photo #1" and 2 are meaningless.
    2. The script, as it is now, will only upload one picture at a time, and it is always going to be the first one. The second is called T1 and it will never be uploaded, unless you rename it and also change the script. As it is now, your visitor should fill in once, the first upload filed, submit, then fill in again the same field with the second picture, and submit again. The second upload field is useless.

    Isn't 20.000.000 (20 Mb) too much for a pic size ?
    3. The Canvas size buttons are also useless for the second pictures, as they have the same group name as the ones of the first picture.

    There is no validation or required fields. If the client forgets to fill in his details, how can you contact him ?

    This is the reason for the existance of ABVFP. It will perform multiple uploads, it will check if all required fields have been filled in, it will inform the visitor of his errors, and it will also send him an autoresponder message to inform him that his enquiry has been received.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • Dween Bean
      Staff Sergeant

      • May 2006
      • 46

      #3
      Re: Parse Error with Uploadaction.php

      HI Naval:
      Thanks for your suggestions. I am starting over with Advance BV Form Processor. Wondered if there was a way to show a progress bar when uploading files on the form. Is this a Flash element that one could incorporated? I'd like to be able to let the customer know what stage their upload is in.
      I await your response.
      Dween Bean

      Comment

      • navaldesign
        General & Forum Moderator

        • Oct 2005
        • 12080

        #4
        Re: Parse Error with Uploadaction.php

        No, php will not allow for a progress bar because it can't populate the row data buffer with the ... Oh well, too technical.

        There are some progress bar scripts on the net (i think you should search it with "upload progress bar" ) but they are a bit complicated. Based on AJAX (most of them)
        Navaldesign
        Logger Lite: Low Cost, Customizable, multifeatured Login script
        Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
        DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
        Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

        Comment

        Working...
        X