Newbie

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • sbohay
    Private First Class

    • Sep 2006
    • 9

    Newbie

    Hello. I need help with my uploading a file form. I followed the tutorial to the t, and it is not working.
    What i need is to receive an uploaded picture from a customer and then forward them to the shopping cart to pay for their order. So i have created the error page and thank-you page (which is actually where they can then click to go on to the shopping cart). I have created other forms successfully, and I am stumped!
    Can somebody please help me.
    My site is jackandaddy.com and the page is under Book nameplates. If you scroll down to the bottom, it is the last form. I actually receive the info in my email but I cannot use the link to accesspicture and the customer only receives an error message, that says
    Warning: Cannot modify header information - headers already sent by (output started at /home2/posh/public_html/uploadaction.php:11) in /home2/posh/public_html/uploadaction.php on line 56.
    I did not change the upload action script except where indicated.
    PLEASE HELP!
    Samantha
  • scubadiver
    Lieutenant Colonel

    • Aug 2006
    • 553

    #2
    Re: Newbie

    Smantha, I want to let you know that I symthasize with you. I, too, am having problems with an error message that came out of the blue. We are in the right place and someone will come to our aid.
    www.hawaiionyourown.com

    Comment

    • Andy128
      Major General

      • Dec 2005
      • 2317

      #3
      Re: Newbie

      Samantha- Please copy and paste the php code that you used to process the form.

      Andy
      PHP- is a blast!

      Comment

      • sbohay
        Private First Class

        • Sep 2006
        • 9

        #4
        Re: Newbie

        Hello, thanks, I really appreciate the help!
        The code is as follows:


        <?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 >1000000)
        {
        //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 = "<A href="http://www.jackandaddy.com/uploads/".$upload_Name">http://www.jackandaddy.com/uploads/".$upload_Name ;
        }
        //Sending Email to form owner
        $mailto = "photoupload@jackandaddy.com";
        $mailsubj = "Photo Upload Submission";
        $mailhead = "From: $email\n";
        reset ($HTTP_POST_VARS);
        $mailbody = "Bookplate photo submission :\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");
        ?>

        And I created the uploadaction.php page an error page and a thank-you page which directs you to my shopping cart.

        I hope this helps.
        Samantha

        Comment

        • sbohay
          Private First Class

          • Sep 2006
          • 9

          #5
          Re: Newbie

          Oh, and Andy as I mentioned earlier I do receive all of the information from the form in my email photoupload@jackandaddy.com.
          However, I do not seem to be able to open the picture that is sent. It is sent with a link upload: http://www.jackandaddy.com/uploads/3monthsweb.jpg but when I click the link I get
          404 ERROR- Page can not be displayed or found.

          I am confused!

          Comment

          • Andy128
            Major General

            • Dec 2005
            • 2317

            #6
            Re: Newbie

            Well- you have;
            $upload_URL = "<A href="http://www.jackandaddy.com/uploads/".$upload_Name">http://www.jackandaddy.com/uploads/".$upload_Name ;
            While the instructions that you followed for the upload have;
            $upload_URL = "http://www.yourdomain.com/uploads/".$upload_Name ;
            Uploads are not my strong point- but perhaps this might be worth changing.

            Additionally- have you changed the CHMOD settings of the "uploads" folder to 777?

            Andy
            PHP- is a blast!

            Comment

            • navaldesign
              General & Forum Moderator

              • Oct 2005
              • 12080

              #7
              Re: Newbie

              The page not found error occurs probably because the file name contains blank spaces or symbols, that break the link. Just copy the ENTIRE link, underlined and not underlined part, in your browser address bar, and it will work ok.

              Now, as for the main part: i have tested your form and it is working ok. So i suppose that you have corrected the mistake. Did you initially upload the "uploadaction.php" script , pasting it in the "Inside Body" of a BV page ? This is a method used for a simple form, but in the case of the upload file script, it needs to be uploaded on the server on it's own. It can be done also the other way, but it should be modified.
              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