Announcement

Collapse
No announcement yet.

Script help!

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

  • Script help!

    Hi,
    can anyone help with a script for my form. The form can be found at www.lionegg.co.uk/temp.html its only a small form, all fields are required and i need the image (with size limit) to be recieved as an attachment with the rest of the information when it is sent. I understand it currently goes to a default folder but this would not be good for me (and when previously testing i couldnt even find this folder!). Thank-you in advance.

    Darren

  • #2
    Re: Script help!

    1. Your field are all named T1 which is the default name BV gives them
    2. 3 Kb is only enough for small thumbnails, not for images.
    3. Receiving the file as an attachment could be a little difficult. If it gets uploaded on the server, and you have the link in the email, you can simply click the link, to open the imege in IE, and then save it on your computer with the right click "Save Image as.." feature, or simply download it with BlueFTP.
    4. You couldn't find the upload folder because this is a folder YOU MUST CREATE. You create it, and then the script uploads the pics in that folder.

    As for the script it self, if this solution is good for you, i can create it for you. However, a little search in the web could also help you find the solution to specific problems you might have.
    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


    • #3
      Re: Script help!

      Hi,

      I had just created the form quickly as an example, i forgot about renaming the fields ( i think that demonstartes how much help i need lol). I am only really in need of small thumbnails, so i thought 3kb would be suitable, however its still in debate.
      The link to the image in the email sounds like a grand idea, and would have the same goal.

      I found form processors on hotscripts.com are these a worth while solution?

      Comment


      • #4
        Re: Script help!

        Some of them are, but most of them are hard to configure and they cost. Prepare your form, create a thankyou and two error pages (for empty field and for non truelike email) publish the pages and let me know the urls and your domain. I'll give you the script.
        Last edited by navaldesign; 03-22-2006, 05:12 PM.
        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


        • #5
          Re: Script help!

          Hi Darren and Naval Design,

          This sounds like you have the same problem as myself Darren. Will you put the script on here naval design so that i can have a look?

          Thanks

          Nick

          Comment


          • #6
            Hi Navaldesign

            Hi Navaldesign,

            The form page can be found at http://www.lionegg.co.uk/upload.html
            The field error page at http://www.lionegg.co.uk/upload_errortype1.html
            Non true email page at http://www.lionegg.co.uk/upload_errortype2.html
            And thankyou page at http://www.lionegg.co.uk/upload_thankyou.html

            Thank you so much for this, very much apprciated.

            Comment


            • #7
              Re: Script help!

              Ok, i'll check your form and send you the script tomorrow.
              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


              • #8
                Re: Script help!

                Thanks thats great!

                Comment


                • #9
                  Re: Script help!

                  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.
                  Last edited by navaldesign; 03-26-2006, 06:03 PM.
                  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


                  • #10
                    Re: Script help!

                    Hi Naval Design

                    Hope you don't mind but I'm trying to use this script myself as I have the same problem.
                    I have followed your instructions and after attempting to upload an image got the message:
                    Parse error: parse error, unexpected T_STRING in /home/dznxeig/public_html/upload1.php on line 69

                    My sample form is found at http://www.yourlocal.org.uk/upload.html

                    Thanks this has been a huge help.

                    Nick

                    Comment


                    • #11
                      Re: Script help!

                      Please try now. There has been a problem with the text editor, resulting in translating a link in a A <href....> where it shouldn't be in line 60. It should work ok now.
                      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


                      • #12
                        Re: Script help!

                        Hi

                        I've altered the upoad1.php and thats has got rid of the error in line 69 message, but now I only get the errortype2 page coming up. I think that I may of set something up incorrectly. On the form properties I take it that I set the action to upload1.php, method=post and encoding blank or am I most probably wrong. When I created the download folder I put it in the public_html file not the public_ftp and likewise with the upload1.php. Any help would be a big help.

                        Many Thanks

                        Nick

                        Comment


                        • #13
                          Re: Script help!

                          Originally posted by nick1346
                          Hi

                          I've altered the upoad1.php and thats has got rid of the error in line 69 message, but now I only get the errortype2 page coming up. I think that I may of set something up incorrectly. On the form properties I take it that I set the action to upload1.php, method=post and encoding blank or am I most probably wrong. When I created the download folder I put it in the public_html file not the public_ftp and likewise with the upload1.php. Any help would be a big help.

                          Many Thanks

                          Nick
                          Encoding=multipart / form data and try. Please also note that this script has been prepared for lionegg. This means that the field names are suited to his form. If one of your fileld names is even slightly different, the script considers that field to be blank, and gives you the errortype2
                          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


                          • #14
                            Re: Script help!

                            Hi Navaldesign,

                            Excellent almost there, I changed the form properties as you said and yes I had one to many spaces in my email field name! Now all the pages work but it still does not send the photo to my upload file, any ideas?

                            Thanks again

                            Nick

                            Comment


                            • #15
                              Re: Script help!

                              Originally posted by nick1346
                              Hi Navaldesign,

                              Excellent almost there, I changed the form properties as you said and yes I had one to many spaces in my email field name! Now all the pages work but it still does not send the photo to my upload file, any ideas?

                              Thanks again

                              Nick
                              Please upload me here a copy of the email you get
                              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