Script help!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • nick1346
    Major

    • Jan 2006
    • 314

    #31
    Re: Script help!

    Hi Gents

    It works! Thanks for all your help and patience navaldesign without this I would be up the creek without a paddle.
    The last issue I had was in fact easily sorted the name of the thankyou page just needed to be changed, bearing that in mind the above code works perfectly.
    Thanks again

    nick

    Comment

    • Girlonthehill
      General

      • Oct 2005
      • 4193

      #32
      Re: Script help Please Naval?

      Originally posted by navaldesign
      Ok, this is your script:
      <?php
      // Receiving variables
      @$CONTACT_EMAIL_ADRESS = addslashes($_POST['CONTACT_EMAIL_ADRESS']);
      @$COMMENT = addslashes($_POST['COMMENT']);
      @$TITTLE = addslashes($_POST['TITTLE']);
      @$IMAGE_Name = $_FILES['IMAGE']['name'];
      @$IMAGE_Size = $_FILES['IMAGE']['size'];
      @$IMAGE_Temp = $_FILES['IMAGE']['tmp_name'];
      @$IMAGE_Mime_Type = $_FILES['IMAGE']['type'];
      function RecursiveMkdir($path)
      {
      if (!file_exists($path))
      {
      RecursiveMkdir(dirname($path));
      mkdir($path, 0777);
      }
      }

      // Validation
      if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $CONTACT_EMAIL_ADRESS))
      {
      header("Location: upload_errortype2.html");
      exit;
      }
      if (strlen($CONTACT_EMAIL_ADRESS) == 0 )
      {
      header("Location: upload_errortype1.html");
      exit;
      }
      if (strlen($COMMENT) == 0 )
      {
      header("Location: upload_errortype1.html");
      exit;
      }
      if (strlen($TITTLE) == 0 )
      {
      header("Location: upload_errortype1.html");
      exit;
      }
      if ($IMAGE_Size>0)
      {
      if( $IMAGE_Size >50000)
      {
      //delete file
      unlink($IMAGE_Temp);
      header("Location: upload_errortype3.html");
      exit;
      }


      if( $IMAGE_Mime_Type != "image/gif" AND $IMAGE_Mime_Type != "image/jpeg" AND $IMAGE_Mime_Type != "image/png" AND $IMAGE_Mime_Type != "image/tiff" )
      {
      unlink($IMAGE_Temp);
      header("Location: upload_errortype4.html");
      exit;
      }


      $uploadFile = "upload/".$IMAGE_Name ;
      if (!is_dir(dirname($uploadFile)))
      {
      @RecursiveMkdir(dirname($uploadFile));
      }
      else
      {
      @chmod(dirname($uploadFile), 0777);
      }
      @move_uploaded_file( $IMAGE_Temp , $uploadFile);
      chmod($uploadFile, 0644);
      $IMAGE_URL = "http://www.yourdomain.co.uk/upload/".$IMAGE_Name ;
      }
      // Find Server date and Time
      $date = date("l jS F Y, g:i A");

      // Find Browser and IPaddress
      $browser =$_SERVER['HTTP_USER_AGENT'];

      $ip = $_SERVER['REMOTE_ADDR'];

      //Sending Email to form owner
      $pfw_header = "From: $CONTACT_EMAIL_ADRESS\n"
      . "Reply-To: $CONTACT_EMAIL_ADRESS\n";
      $pfw_subject = "New Picture Upload";
      $pfw_email_to = "youremail@yourdomain.co.uk";
      $pfw_message = "A new Picture has been uploaded\n"
      . "-----------------------------------------\n"
      . "\n"
      . "\n"
      . "CONTACT_EMAIL_ADRESS: $CONTACT_EMAIL_ADRESS\n"
      . "COMMENT: $COMMENT\n"
      . "TITTLE: $TITTLE\n"
      . "IMAGE: $IMAGE_URL\n"
      . " \n"
      . "Date of upload : $date\n"
      . "Browser : $browser\n"
      . "IP address : $ip\n";


      *****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
      header("Location: thankyou_page.html");
      ?>


      Please follow these steps:
      1. Copy and paste this code in Notepad. Change your email address, with one of your vodahost account emails. Go to "Save As", choose File Type "All Files", and save it as "upload1.php" . Upload it on the server.
      2. Create a folder in your public_html, called "upload". This is where all the images will be stored. Set permissions for this folder in 777
      3. Create two more error pages: "upload_errortype3.html" and "upload_errortype4.html" the first for File size exceeding 50 kb (this is the limit i have put, you may change it to be 3 - 5 or what you want kb (The size is in Bytes) and the second for wrong file type (i have put jpeg, png, tiff and gif as acceptable types)

      Test the script and let me know.
      Hi Naval!

      I am building a new site and want clients to be able to upload between one and four photographs. I am wondering whether this script you so kindly prepared and your excellent instructions, will work for me? I'll do it myself if you give me the go-ahead :o) I know you have plenty plenty on your plate at the moment. Thank you, as always, my friend.

      VodaHost

      Your Website People!
      1-302-283-3777 North America / International
      02036089024 / United Kingdom
      291916438 / Australia

      ------------------------

      Top 3 Best Sellers

      Web Hosting - Unlimited disk space & bandwidth.

      Reseller Hosting - Start your own web hosting business.

      Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


      Comment

      • Girlonthehill
        General

        • Oct 2005
        • 4193

        #33
        Re: Script help!

        With reference to my previous post - please disregard. My form is far more complicated than the one above so I will just have a go and if I get stuck which is more than likely, I will shout for HELP!

        VodaHost

        Your Website People!
        1-302-283-3777 North America / International
        02036089024 / United Kingdom
        291916438 / Australia

        ------------------------

        Top 3 Best Sellers

        Web Hosting - Unlimited disk space & bandwidth.

        Reseller Hosting - Start your own web hosting business.

        Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


        Comment

        • navaldesign
          General & Forum Moderator

          • Oct 2005
          • 12080

          #34
          Re: Script help!

          Originally posted by Girlonthehill
          With reference to my previous post - please disregard. My form is far more complicated than the one above so I will just have a go and if I get stuck which is more than likely, I will shout for HELP!
          Hi Amanda, not a problem at all. Just let me know. Sorry for the delay, i've been abroad.
          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

          • tuffticky
            Private

            • May 2006
            • 2

            #35
            Re: Script help!

            Hi, this is Tynia, I'm working on setting up a form to upload images as well. I also used the above script for uploading images, I can get all the information but I cannot get the image to upload into the upload folder. Can you give me some insight into why this might be happening? I see others are still having the problem as well. Thanks for your help.

            Tynia/Pierre
            Customer 5614

            Comment

            • navaldesign
              General & Forum Moderator

              • Oct 2005
              • 12080

              #36
              Re: Script help!

              I need your loggin info to have an insight look. Use my form to send me IP, username and password. Also let me know the URL of your form
              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

              • tuffticky
                Private

                • May 2006
                • 2

                #37
                Re: Script help!

                Hi. We just sent you the info via the form on Naval Design. Hope you can help us. Thanks again for your help.

                Tynia/Pierre

                Comment

                Working...
                X