Results 1 to 7 of 7

Thread: Newbie
      
   

  1. #1
    sbohay is offline Private First Class
    Join Date
    Sep 2006
    Posts
    9

    Question 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

  2. #2
    scubadiver's Avatar
    scubadiver is offline Lieutenant Colonel
    Join Date
    Aug 2006
    Location
    Hawaii
    Posts
    553

    Default 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.

  3. #3
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Newbie

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

    Andy
    PHP- is a blast!

  4. #4
    sbohay is offline Private First Class
    Join Date
    Sep 2006
    Posts
    9

    Default 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

  5. #5
    sbohay is offline Private First Class
    Join Date
    Sep 2006
    Posts
    9

    Default 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!

  6. #6
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default 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!

  7. #7
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default 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!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49