Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Location
    Liverpool
    Posts
    96
    Plugin Contributions
    0

    Default Email Notifications

    I have the following PHP code for a file upload on mysite. Can anyone provide me with what extra code I would need so the system sends me an email when a file is uploaded?
    PHP Code:
    <?php

    if ((($_FILES["file"]["type"] == "image/gif")

    || (
    $_FILES["file"]["type"] == "image/jpeg")

    || (
    $_FILES["file"]["type"] == "image/png")

    || (
    $_FILES["file"]["type"] == "image/pjpeg"))

    && (
    $_FILES["file"]["size"] < 2048000))

      {

      if (
    $_FILES["file"]["error"] > 0)

        {

        echo 
    "Return Code: " $_FILES["file"]["error"] . "<br />";

        }

      else

        {

        echo 
    "File Name: " $_FILES["file"]["name"] . "<br />";

        echo 
    "Type: " $_FILES["file"]["type"] . "<br />";

        echo 
    "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
        
        echo 
    "<hr width='75%'>";
        
        echo 
    "<span id='gallery'>Thank you for your interest in our Gallery. If your image is successfully uploaded, please use our <a href='http://www.blackwolf-graphics.co.uk/index.php?main_page=contact_us'>Contact Us</a> form to let us know you have uploaded an image file and quote the file name <span id='file'>'"$_FILES["file"]["name"] ."'</span> and you'll receive your discount code within 12 hours.</span><br /><br />" "<br />";




        if (
    file_exists("upload/" $_FILES["file"]["name"]))

          {

          echo  
    "<span id='error'>'".$_FILES["file"]["name"] . "'<span id='error'> ALREADY EXISTS.</span><br><br><span id='errorsmall'>Please rename your file.</span> ";

          }

        else

          {

          
    move_uploaded_file($_FILES["file"]["tmp_name"],

          
    "upload/" $_FILES["file"]["name"]);


          }

        }

      }

    else

      {

    echo 
    "File Name: " $_FILES["file"]["name"] . "<br />";

        echo 
    "Type: " $_FILES["file"]["type"] . "<br />";

        echo 
    "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
      echo 
    "<span id='error'>INVALID FILE TYPE OR SIZE</span><br><span id='gallery'>Please note only GIF,JPG,JPEG & PNG are allowed file types and up to a maximum of 2MB.<br><br>Please <a href='http://www.blackwolf-graphics.co.uk/index.php?main_page=page_2'>try again</a></span>";

      }

    ?>

  2. #2
    Join Date
    Nov 2007
    Location
    Melbourne, Australia
    Posts
    552
    Plugin Contributions
    0

    Default Re: Email Notifications

    You can use the zencart email function. They are located at \includes\functions\functions_email.php
    Read the documentation how to use them. Its quite straightforward.

 

 

Similar Threads

  1. Email notifications
    By bgrenier1971 in forum General Questions
    Replies: 0
    Last Post: 8 Oct 2009, 11:08 AM
  2. Email Notifications
    By jdw1979 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 Jul 2009, 04:57 PM
  3. Email Order Notifications
    By pytho3 in forum Managing Customers and Orders
    Replies: 2
    Last Post: 6 Dec 2007, 06:14 PM
  4. Can not get email notifications - new install
    By adolgin in forum Managing Customers and Orders
    Replies: 12
    Last Post: 7 Jul 2007, 04:20 PM
  5. No Email Notifications
    By babydi77 in forum Managing Customers and Orders
    Replies: 4
    Last Post: 12 Jul 2006, 01:29 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
  •