Как отправить данные из двух форм?

316
19 августа 2017, 03:39

Попытался отправить данные с помощью document.getElementById ('form1').submit (); но никак не работает все равно записывает значение 0

         <?php if(!defined("TT_YAZILIM")){ 
    // echo "IP adresiniz banlanmıştır";
   echo "<script>window.top.location.href = '../index.html';</script>";
   exit();
    } ?>
<script>
function check_iletisim(){
    if (document.iletForm.ad.value == ""){
        alert ("<?=_BE_23?>");
        document.iletForm.ad.focus();
        return false;  
    }

        if (document.iletForm.email.value == ""){
        alert ("<?=_BE_4?>");
        document.iletForm.email.focus();
        return false;  
    }
    else
    {
    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    if(pattern.test(document.iletForm.email.value)){
      }else{
    alert("<?=_BE_4?>");
    document.iletForm.email.focus();
    return false;
    }

    }
        if (document.iletForm.konu.value == ""){
        alert ("<?=_BE_26?>");
        document.iletForm.konu.focus();
        return false;  
    }
        if (document.iletForm.mesaj.value == ""){
        alert ("<?=_BE_27?>");
        document.iletForm.mesaj.focus();
        return false;
    }
        if (document.iletForm.mesaj.value.length<10 || document.iletForm.mesaj.value.length>2000){
        alert ("<?=_BE_28?>");
        document.iletForm.mesaj.focus();
        return false;   
    }

            if (document.iletForm.gkod.value == ""){
        alert ("<?=_BE_29?>");
        document.iletForm.gkod.focus();
        return false;
    }

 }
</script>
<div class="yeni_orta_modul">
<div class="yeni_baslik">
Sifariş et
</div>
</div>
<div class="yeni_tek">

<?php
$fid=$_POST['fid'];
$name=$_POST['name'];
$price=$_POST['price'];
$discount=$_POST['discount'];
$firma=$_POST['firma']
 ?>
<style>
.cart_view {
    border: 1px solid rgb(179, 179, 179);
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    width: 50%;
    background: white;
    min-height: 90px;
    text-align: left;
    color: black;
    font-size: 12px;
    z-index: 500;
    font-family: Arial;
    background: #fff;
    padding: 15px;
}

#basket_area {
    display: block;
    margin: 3px;
    padding: 6px;
    z-index: 999;
    background: #fff;
}

.cart_view{border:1px solid rgb(179, 179, 179);-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;width:50%;background:white;min-height:90px;text-align:left;color:black;font-size:12px;z-index:500;font-family:Arial;background:#fff;padding:15px;}
.sebet_right_blok{float:left;width:45%;border:1px solid rgb(179, 179, 179);border-radius:10px;min-height:90px;margin-left:10px;background:white;}
.sebet_pr_name_title{width:290px;display:inline-block;word-wrap:break-word;font:bold 16px arial;}
.sebet_pr_price_title{display:inline-block;margin-left:10px;width:70px;font:bold 16px arial;}
.sebet_pr_say_title{display:inline-block;width:70px;margin-left:10px;font:bold 16px arial;}
.sebet_pr_sil{margin-left:10px;}
.sebet_pr_name{width:290px;display:inline-block;word-wrap:break-word;font:Normal 20px arial;}
.sebet_pr_price{display:inline-block;margin-left:10px;width:70px;font:Normal 12px arial;color:red;}
.sebet_pr_say{display:inline-block;width:74px;margin-left:10px;font:Normal 11px arial;overflow:hidden;}
.irali2{float:right;margin-bottom:10px;margin-right:15px;padding:15px 26px;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;border:none;display:inline-block;text-decoration:none;background:#B2B204;color:#fefefe;font-weight:bold;cursor:pointer;font-size:18px;}
.irali2:hover{background:#D7D70C;}
</style>

<div class="cart_view" id="cart_view" style="float: left; display: block;">
        <div id="basket_area">
            <div style="width:100%;" id="shopping_cart">
                <div>
                <span class="sebet_pr_name"><b style="color:red">Firma:</b><?php echo $firma; ?></span>
                    <div>
                    <hr style="border-bottom:1px solid rgb(179, 179, 179); margin:15px 0px 5px 0px;">
                    </div>
                </div>
                <div id="basket_item_area">
                <span id="buy_3" class="buy_row">
                <span class="sebet_pr_name"><b style="color:red">Adı:</b><?php echo $name; ?></span>
                </span>
                </div>
            </div>
            <hr style="border-bottom:1px solid rgb(179, 179, 179); margin:15px 0px 5px 0px;">
            <div style="display:table; width:99%;">
                <div style="font-family:arial; font-size:12px; float:left; display:block;">
                    </div>
                    <script type="text/javascript">
                        $(document).ready(function(){

                            $(".slidingDiv").hide();
                            $(".show_hide").show();
                            $('.show_hide').click(function(){
                            $(".slidingDiv").slideToggle();
                            });
                        });
                    </script>


                        <div style="color:#cc0000;"><br><br>
                        </div>
                </div>
                <?  //Форма расчета стоимости и количество товара ?>
                <form onsubmit="return false;"
            oninput=" 
            document.getElementById('rezultat').innerHTML 
                = 
            parseFloat(document.getElementById('a').value)
            *
            parseFloat(document.getElementById('b').value)
            "
                >
<b>Sayı</b> <input id="a" type="number" style="width:40px;border: 1px solid #CCC; text-align: center;" value="1"> 
<input id="b" type="hidden" value="<?php echo ($price-($price*$discount)/100); ?>">

                <span style="float: right;text-align: right;font-size: 14px;font-family: tahoma;line-height: 25px;">
                    <span id="bskt_total" style="font-weight:bold;">Qiymət:<?php echo $price; ?> AZN</span><br>
                    <span id="bskt_discount" style="font-weight:bold; color:red;">Endirim:<?php echo $discount; ?>%</span><br>

                    <span id="bskt_total" style="font-weight:bold;">Cəmi:<output id="rezultat"><?php echo ($price-($price*$discount)/100); ?></output> AZN</span><br>
                    <input type="hidden" name="item_count" value="10" id="item_count">
                </span>
                <div style="float:left; width:100%; height:10px;"></div>
                <br>
                <br>
                    <br><br>
        </form>
        </div>
    </div>



                       <?php  

    //Отправка данных формы в бд
if(isset($_POST['git']))
{
if( $_POST['git'] ) {

    $spamyapan =_ILETISIM_3;
if (preg_match("/http/i", "".temizle($_POST['mesaj']).""))
     {
    echo "<div class='hata'>".$spamyapan."</div>";
    echo " <meta http-equiv='refresh' content='4;URL=index.html'> "; 
    }
    else
    {

     include("securimage/securimage.php");
  $img = new Securimage();
  $valid = $img->check($_POST['gkod']);
  if($valid == true) 
    {
$say=$_POST['a'];
$cemi=$say*($price-($price*$discount)/100);
$fid2=$_POST['fid2'];         
$time=time();   
$konu=$site_adi. " "._ILETISIM_4;   
$mesaj = "<P><b>Ad Soyad: </b>".temizle($_POST['ad'])."</p>
<p><b>Firma: </b>".temizle($_POST['fname'])."</p>
<p><b>Sifariş edilən malın adı: </b>".temizle($_POST['name2'])."</p>
<p><b>Sayı: </b>".temizle($_POST['say'])."</p>
<p><b>Cəmi qiymət: </b>".temizle($_POST['cemi'])."</p>
<p><b>"._KONU.": </b>".temizle($_POST['konu'])."</p>
<p><b>"._EMAIL.": </b>".temizle($_POST['email'])."</p>
<p><b>"._TELEFON.": </b>".temizle($_POST['tel'])."</p>
<p><b>"._TELEFON.": </b>".temizle($_POST['tel2'])."</p>
<p><b>Çatdırılacaq ünvan: </b>".temizle($_POST['unvan'])."</p>
<p><b>"._MESAJ.": </b> ".temizle($_POST['mesaj'])."</p>";  

var_dump($fid);
var_dump((int)$fid);
$ekle=mysql_query("INSERT INTO `mesajgiden`(`m_id`, `mesaj`, `tarih`, `baslik`, `kimden`, `kime`) VALUES ('','$mesaj','$time','Sifariş','5845','$fid2')")
        or die(mysql_error());
$ekle2=mysql_query("INSERT INTO `mesajgelen`(`m_id`, `kimden`, `kime`, `tarih`, `okudum`, `baslik`, `mesaj`, `onay`) VALUES ('','5845','$fid2','$time','0','Sifariş','$mesaj','1')")
  or die(mysql_error());

 echo "<div class='tebrik'>"._MESAJ_TEBRIK."</div>";
 echo " <meta http-equiv='refresh' content='2;URL=index.html'> "; 
    }
    else
    {
     echo "<div class='hata'> <a href='index.html'> "._YANLIS_KOD."</a></div>";
}
    }
}
}
//isset sonu
else
{
//Конец отправки данных в бд
?>
<form  action="index.php?pg=sifariw" method="post" name="iletForm"  onSubmit="return check_iletisim()" class="cmxform" id="iletForm"  >  
   <fieldset>
    <p>
         <label for="ad"><?=_AD_SOYAD?> :</label>
      <input type="text" name="ad" id="ad" maxlength="150" />*
    </p>

        <p>
         <label for="email"><?=_EMAIL?> :</label>
      <input type="text" name="email" id="email" required maxlength="255" />*
 </p>
        <p>
         <label for="tel"><?=_TELEFON?> :</label>
      <input type="text" name="tel" id="tel" required maxlength="30" />
 </p>
 <p>
         <label for="tel"><?=_TELEFON?> :</label>
      <input type="text" name="tel2" id="tel2" maxlength="30" />
 </p>
        <p>
         <label for="Konu"><?=_KONU?></label>
      <input type="text" name="konu" id="konu" maxlength="255" />*
 </p>
 <p>
         <label for="unvan">Çatdırılacaq ünvan</label>
      <input type="text" name="unvan" id="unvan" maxlength="255" />*
 </p>
        <p>
         <label for="mesaj"><?=_MESAJ?>:</label>
      <textarea name="mesaj"></textarea>*
 </p>


       <p><label></label><img src="securimage/securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"></p>
        <p><label for="gkod"><?=_GKOD?>:</label><input type="text" name="gkod" id="gkod" maxlength="5" size="30"></p>


<p>         
            <input type="hidden" name="say" value="<?php echo $say; ?>" />
            <input type="hidden" name="cemi" value="<?php echo $cemi; ?>"   />
            <input type="hidden" name="fid2" value="<?php echo $fid; ?>"    />
            <input type="hidden" name="name2" value="<?php echo $name; ?>"  />
            <input type="hidden" name="firma" value="<?php echo $fname; ?>" />
            <input class="submit" name="git" type="submit" value="<?=_GONDER?>"/> 

        </p>
                </fieldset>
</form>  
<?php } ?> 
</div>
READ ALSO
`use strict` не переводит функцию в строгий режим?

`use strict` не переводит функцию в строгий режим?

Если написать use strict в косых апострофах, то функция не переходит в строгий режимВерно ли это поведение?

155
ajax php include не подключает файл?

ajax php include не подключает файл?

Всем добрый день!

236
аудио библиотеки для php

аудио библиотеки для php

Всем привет! Кто может подсказать библиотеку для перевода из mp4 во flac на phpПробовал Sox, но он не поддерживает mp4

154
Убрать блок, и по кнопке показать модальное окно с ним

Убрать блок, и по кнопке показать модальное окно с ним

Помогите, сделать чтобы при загрузке второго блок не было видно - div class="tabs__content active_tab

253