Results 1 to 1 of 1

Thread: Upload with email alert

  1. #1
    Join Date
    Oct 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Upload with email alert

    heya all!

    Here is an example HTML form that I would like to use... very similar to the one I am currently using, but with some wish list features added, or at least an attempt at adding them...

    <strong>To upload your site document, please follow the steps listed below.</strong>
    <p><br />
    <strong>1)</strong> Right click on your site file, and select compress so that your site is sent to a .zip file.
    <br />
    <strong>2)</strong> Rename the .zip file so that it contains no spaces, and is a single word, followed by .zip.
    <br />
    <strong>3)</strong> Click on the &quot;Choose File&quot; button to bring up a browser in which you can select your zipped site file.
    <br />
    <strong>4)</strong> Enter your name, email address and case number.
    <br />
    <strong>5)</strong> Click on the &quot;Send File&quot; button.
    <p><br />
    <strong>Make sure that the file uploaded properly before closing the page. There is no need to email us to tell us that the file has been uploaded, as we are automatically alerted, and it is appended to your case file.</strong>
    <p><br />
    <form enctype="multipart/form-data" action="upload.php" method="POST">
    <!-- hidden inputs -->
    <input name="TO" type="hidden" value="Email Address Here"></input>
    <input name="URL" type="hidden" value="Website Address Here"></input>
    <input name="SUBJECT" type="hidden" value="Upload from Case# [[AUTO INSERT CASE NUMBER FROM TEXT FIELD]]"></input><p><br />
    <input type="hidden" name="MAX_FILE_SIZE" value="1000000"></input>
    Choose a file to upload: <input name="uploadedfile" type="file"></input></p>
    <p><br />
    <!-- visible inputs -->
    Your Name: <input name="name" size="42"></input></p>
    <p><br />
    Email Address: <input name="Email" size="39"></input></p>
    <p><br />
    Case Number: <input name="Case Number" size="40"></input></p>
    <p><br />
    <input type="submit" value="Upload File"></input>
    </p>
    </form>
    This is my upload.php file as it currently exists... and without the features that I would like.

    PHP Code:
    <?php 
    $target 
    "upload/"
    $target $target basename$_FILES['uploaded']['name']) ; 
    $ok=1
    //This is our size condition 
    if ($uploaded_size 1000000

    echo 
    "Your file is too large.<br>"
    $ok=0

    //This is our limit file type condition 
    if ($uploaded_type =="text/php"

    echo 
    "No PHP files<br>"
    $ok=0

    //Here we check that $ok was not set to 0 by an error 
    if ($ok==0

    Echo 
    "Sorry your file was not uploaded"

    //If everything is ok we try to upload it 
    else 

    if(
    move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 

    echo 
    "The file ".
    basename$_FILES['uploadedfile']['name']). " has been uploaded"

    else 

    echo 
    "Sorry, there was a problem uploading your file."


    ?>
    Unfortunately, 90% of the time, my current form just says that "Sorry, there was a problem uploading your file", so essentially I am looking for a completely new script.

    What I would LIKE to do, is somehow add an additional field to the HTML form for the customer to enter their Case Number. Then, I would like the Case number field to be used with an additional php command to send an email to me with the Case number from the HTML field form as the subject line, and a generated link to the uploaded file as the message.

    The link would just be http://myserver.com/filename

    Is this possible? Has anyone else tried this or been successful?

    Thanks ahead of time....
    Last edited by webform; 10-04-2007 at 03:35 AM.

Bookmarks

Posting Permissions

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