My form

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

    • Jan 2006
    • 314

    #16
    Re: My form

    Hi Davaidundalicia (David and Alicia?)

    Thanks for your response I picked the form bit up but not this at first! The code on the contact page I haven't even looked at to honest as this 'upload page' is the important one. I Have a feeling the problem rests in my email setup but I want to be proved wrong.
    Your site by the way? Is that place up as a holiday villa?Let me know
    Cheers mate
    Nick

    Comment

    • nick1346
      Major

      • Jan 2006
      • 314

      #17
      Re: My form

      sorry the code link for the main contactlink page!!!

      Comment

      • davidundalicia
        General

        • Mar 2006
        • 6294

        #18
        Re: My form

        hi nick,
        Thanks for the code, I will study it in the morning when I am less tired.
        Yes Alicia is my better half, hence, D&A.
        My holiday place to let has recently been described as
        a "Penthouse type Apartment" in the sun....
        Feel free to book any time.............................
        Have fun
        Regards..... David

        Step by Step Visual Tutorials for the complete beginner
        Newbies / Beginners Forum
        FREE Membership Login Scripts: - Meta Tags Analyzer
        My Social Networking Site - Free Contact Forms
        Finished your New website!! Now get it noticed Here:

        Comment

        • kassi59
          Major General

          • Nov 2005
          • 2771

          #19
          Re: My form

          Originally posted by nick1346
          Hi Kassi,

          Not quite yet, there's still something not right somewhere.
          I asked Naval design to have a look and the code works perfectly for him and it's based on a code he's been running for many months without a hitch. So it must be a server problem right? Aparently not say BV, it's the code they say. If Giorgio says the code is sound then I'll go with that, it may just 'sort' itself. BV have told me how to reset the form by altering my public_html permisions SOOOO what I'd like as many of you as possible to do is attack my form and see how often it works and I'll get an idea of how much of a problem it is.
          One thing Kassi by what you say I get the impression that you've used my form successfully because if you did then I didn't recieve anything, which could mean it's my email?

          Cheers

          Nick

          Im not by any means pro here! - I seemed to have a similar issue with my form. After filling it out it went nowhere..I solved it by re writing the html and gave it direction. below is the outline I used with the script for the clear and submit buttons:
          --------------------------------------------------------------
          <p><br>
          <input type="submit" value="Send">
          <input type="reset" value="Clear the form">
          <!-- Option 1 -->
          <input type="hidden" name="subject" value="Survey Results">
          <!-- Option 2 -->
          <input type="hidden" name="required_fields" value="Name,URL">
          <!-- Option 3
          <input type="hidden" name="next_url" value="http://www.geocities.com//index.html">
          -->
          </form>
          ------------------------------------------------------------------
          I imbarrassingly enough didnt use the BV as Im lazy and never looked to see if there was one! <brutal self honesty!> I have used this and re written to my certain needs in the past and Im used to it, so I just grabbed and ran!
          dont know if that helps or not - but if it does then email me and I can give you more info on the script! - kassi1959****.com

          Comment

          • kassi59
            Major General

            • Nov 2005
            • 2771

            #20
            Re: My form

            I just filled it out and it worked wonderfully. I had an error to go back and insert my true email, I did so, then it submitted nicely.
            When I fill forms, Im a "tab" person, and I did notice that that option is all over the board when I should be directed to the next query..

            Comment

            • nick1346
              Major

              • Jan 2006
              • 314

              #21
              Re: My form

              Thanks kate. I appreciate the help
              I now actually think I've spotted the problem, but i can't sort it put till this evening. It looks like it crashes everytime someone sends one photo, two or no photos works fine, but one crashes it. Easy to fix.
              By the way I'm not sure what you mean in your last post.
              Cheers
              nick

              Comment

              • nick1346
                Major

                • Jan 2006
                • 314

                #22
                Re: My form

                Hello all
                I'm sorry to raise this old chestnut again, but I now know what is causing the problem is. On my form www.yourlocal.org.uk/yourpage2.html
                I have two file attachment bits for photo's, called photo1 and photo2 respectively. Now if both fields have a file attached then all is well, the form sends. If niether filed is sent then all sends fine. The problem is caused when photo1 is the only field completed, this then changes the permisions on my public html folder to 777 and gives out the internal server error. Now the odd thing is that if you fill out photo2 only then it works perfectly. Now I've tried everthing to resolve this by myself I know your all busy enough and I've already recieved a huge amount of support especially from Naval Design, but I just can't get it to work properly. Can I ensure that both photo fields are filled out or that it will send fine no matter which photo fields are filled out. I can sort out the text only validation fields but I'm baffled by this.
                My script
                <?php
                // Receiving variables
                @$name = addslashes($_POST['name']);
                @$company_name = addslashes($_POST['company_name']);
                @$address1 = addslashes($_POST['address1']);
                @$address2 = addslashes($_POST['address2']);
                @$town = addslashes($_POST['town']);
                @$county = addslashes($_POST['county']);
                @$postcode = addslashes($_POST['postcode']);
                @$phone = addslashes($_POST['phone']);
                @$email = addslashes($_POST['email']);
                @$title = addslashes($_POST['title']);
                @$other = addslashes($_POST['other']);
                @$photo1_Name = $_FILES['photo1']['name'];
                @$photo1_Size = $_FILES['photo1']['size'];
                @$photo1_Temp = $_FILES['photo1']['tmp_name'];
                @$photo1_Mime_Type = $_FILES['photo1']['type'];
                @$photo2_Name = $_FILES['photo2']['name'];
                @$photo2_Size = $_FILES['photo2']['size'];
                @$photo2_Temp = $_FILES['photo2']['tmp_name'];
                @$photo2_Mime_Type = $_FILES['photo2']['type'];
                @$namepage = addslashes($_POST['namepage']);
                @$mainbody = addslashes($_POST['mainbody']);
                @$contact = addslashes($_POST['contact']);
                @$postcode2 = addslashes($_POST['postcode2']);
                function RecursiveMkdir($path)
                {
                if (!file_exists($path))
                {
                RecursiveMkdir(dirname($path));
                mkdir($path, 0777);
                }
                }
                // Validation
                if (strlen($email) == 0 )
                {
                header("Location: yourpage2/upload_errortypeemail.html");
                exit;
                }
                if (strlen($name) == 0 )
                {
                header("Location: yourpage2/upload_errortypename.html");
                exit;
                }
                if (strlen($company_name) == 0 )
                {
                header("Location: yourpage2/upload_errortypecomname.html");
                exit;
                }
                if (strlen($address1) == 0 )
                {
                header("Location: yourpage2/upload_errortypeaddress.html");
                exit;
                }
                if (strlen($town) == 0 )
                {
                header("Location: yourpage2/upload_errortypeaddress.html");
                exit;
                }
                if (strlen($county) == 0 )
                {
                header("Location: yourpage2/upload_errortypeaddress.html");
                exit;
                }
                if (strlen($postcode) == 0 )
                {
                header("Location: yourpage2/upload_errotypeaddress.html");
                exit;
                }
                if (strlen($phone) == 0 )
                {
                header("Location: yourpage2/upload_errortypephone.html");
                exit;
                }
                if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
                {
                header("Location: yourpage2/upload_errortypeemail.html");
                exit;
                }
                if (strlen($email) == 0 )
                {
                header("Location: yourpage2/upload_errortypeemail.html");
                exit;
                }
                if (strlen($title) == 0 )
                {
                header("Location: yourpage2/upload_errortypetitle.html");
                exit;
                }
                if ($photo1_Size>0)
                {
                if( $photo1_Size >100000)
                {
                //delete file
                unlink($photo1_Temp);
                header("Location: yourpage2/upload_errortypephoto.html");
                exit;
                }
                }if ($photo2_Size>0)
                {
                if( $photo2_Size >100000)
                {
                //delete file
                unlink($photo2_Temp);
                header("Location: yourpage2/upload_errortypephoto.html");
                exit;
                }
                if (strlen($mainbody) == 0 )
                {
                header("Location: yourpage2/upload_errortypebody.html");
                exit;
                }
                if (strlen($contact) == 0 )
                {
                header("Location: yourpage2/upload_errortypecontact.html");
                exit;
                }

                $uploadFile = "upload/".$photo1_Name ;
                if (!is_dir(dirname($uploadFile)))
                {
                @RecursiveMkdir(dirname($uploadFile));
                }
                else
                {
                @chmod(dirname($uploadFile), 0777);
                }
                @move_uploaded_file( $photo1_Temp , $uploadFile);
                chmod($uploadFile, 0644);
                $photo1_URL = "<A href="http://www.yourlocal.org.uk/upload/".$photo1_Name">http://www.yourlocal.org.uk/upload/".$photo1_Name ;
                }
                $uploadFile = "upload/".$photo2_Name ;
                if (!is_dir(dirname($uploadFile)))
                {
                @RecursiveMkdir(dirname($uploadFile));
                }
                else
                {
                @chmod(dirname($uploadFile), 0777);
                }
                @move_uploaded_file( $photo2_Temp , $uploadFile);
                chmod($uploadFile, 0644);
                $photo2_URL = "<A href="http://www.yourlocal.org.uk/upload/".$photo2_Name">http://www.yourlocal.org.uk/upload/".$photo2_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: $email\n"
                . "Reply-To: $email\n";
                $pfw_subject = "New Picture Upload";
                $pfw_email_to = "info@yourlocal.org.uk";
                $pfw_message = "A new Picture has been uploaded\n"
                . "-----------------------------------------\n"
                . "\n"
                . "\n"
                . "name: $name\n"
                . "company_name: $company_name\n"
                . "address1: $address1\n"
                . "address2: $address2\n"
                . "town: $town\n"
                . "county: $county\n"
                . "postcode: $postcode\n"
                . "phone: $phone\n"
                . "email: $email\n"
                . "title: $title\n"
                . "other: $other\n"
                . "photo1: $photo1_URL\n"
                . "photo2: $photo2_URL\n"
                . "namepage: $namepage\n"
                . "mainbody: $mainbody\n"
                . "contact: $contact\n"
                . "postcode2: $postcode2\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: yourpage2/upload_thankyou.html");
                ?>
                Thanks all
                Nick

                Comment

                Working...
                X