Submits fine from Firefox but not IE?

Discussion in 'PHP' started by dannbkk, Jun 21, 2007.

  1. #1
    When submitted from IE gives me error
    All fields marked with '*' are required to be filled up.
    Please help as i tried to echo this out but still only same error?

    <?php
    
        if (isset($_POST['buy_submit2'])) {
            $seller_name = $_POST['seller_name'];
            $biz_type = $_POST['biz_type'];
            $budget = ereg_replace("[^0-9]", "", $_POST['budget']);
            $location = $_POST['location'];
            $company_name = $_POST['company_name'];
            $address = $_POST['address'];
            $country = $_POST['country'];
            $phone = ereg_replace("[^[:space:]+0-9]", "", $_POST['phone']);
            $email = $_POST['email'];
            $biz_owner = $_POST['biz_owner'];
            $what_type_of_biz = $_POST['what_type_of_biz'];
            $reference = $_POST['reference'];
            $cash_for_investment = ereg_replace("[^0-9]", "", $_POST['cash_for_investment']);
            $time_frame = ereg_replace("[^a-zA-Z0-9]", "", $_POST['time_frame']);
            $comment = nl2br($_POST['comment']);
                if ($seller_name == '' || $biz_type == '' || $budget == '' || $location == '' || $country == '' || $phone == '' || $email == '' || $biz_owner == '' || $cash_for_investment == '' || $time_frame == '' || $comment == '') {
                    echo "All fields marked with '*' are required to be filled up.";
    				echo 'Seller name: '.$seller_name.'<br />';
    				echo 'Biz type: '.$biz_type.'<br />'; 
    				echo 'Budget: '.$budget.'<br />'; 
    				echo 'Location: '.$location.'<br />'; 
    				echo 'Company Name: '.$company_name.'<br />'; 
    				echo 'address: '.$address.'<br />'; 
    				echo 'country: '.$country.'<br />'; 
    				echo 'phone: '.$phone.'<br />'; 
    				echo 'email: '.$email.'<br />'; 
    				echo 'Biz owner: '.$biz_owner.'<br />'; 
    				echo 'what type of biz: '.$what_type_of_biz.'<br />'; 
    				echo 'reference: '.$reference.'<br />'; 
    				echo 'cach for investment: '.$cash_for_investment.'<br />';
    				echo 'time frame: '.$time_frame.'<br />';
    				echo 'comment: '.$comment.'<br />';
                } elseif ($biz_owner == 'yes' && $what_type_of_biz == '') {
                      echo 'Please fill up the type of your business.';
                  } elseif ($biz_owner == 'yes' && $reference == '') {
                        echo 'Please fill up your business reference.';
                    } elseif (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                          echo 'Email is not validate.';
                      } else {
                            $query = "INSERT into buy_biz (id, seller_name, biz_type, budget, location, company_name, address, country, phone, email, biz_owner, what_type_of_biz, reference, cash_for_investment, time_frame, comment) VALUES
                                     ('', '$seller_name', '$biz_type', '$budget', '$location', '$company_name', '$address', '$country', '$phone', '$email', '$biz_owner', '$what_type_of_biz', '$reference', '$cash_for_investment', '$time_frame', '$comment')";
                            mysql_query($query) or die("MySQL Error :" . mysql_error());
                            echo 'Thank you, we will get back to you as soon as possible.';
                        }
        } else {
          }
    ?>
    PHP:
     
    dannbkk, Jun 21, 2007 IP
  2. UnrealEd

    UnrealEd Peon

    Messages:
    148
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What error?
     
    UnrealEd, Jun 22, 2007 IP
  3. dannbkk

    dannbkk Well-Known Member

    Messages:
    1,403
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    120
    #3
    All fields marked with '*' are required to be filled up.
     
    dannbkk, Jun 22, 2007 IP
  4. PenSniffer

    PenSniffer Guest

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    its hard to tell with out a live copy,

    also use

    foreach(array('var1','var2','var3') as $var){
    $$var = htmlentites($_POST[$var]);
    }

    much easyer to read, and quicker to code, and you wont have people doing XSS ;)
     
    PenSniffer, Jun 22, 2007 IP
  5. UnrealEd

    UnrealEd Peon

    Messages:
    148
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    since php is serversided for 100%, there can't be anything wrong with your php code if it works in firefox. The only reason i can think of why the page doesn't work in IE is because of an HTML error. IF it's not too much trouble, would you mind posting your html code please?
     
    UnrealEd, Jun 22, 2007 IP