Salam aşağıdakı kodda sonuncu sətirdə uyğunsuzluq olduğunu deyir zəhmət olmasa kömək edin .
<?php session_start(); require_once('mainconfig.php'); include('header.php'); if(!$_SESSION['account']): ?> <div class="container"> <div style="margin-top:50px;" class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2"> <div class="panel panel-info" > <div class="panel-heading"> <div class="panel-title">Masuk Dengan Akun Panel IG Anda</div> <div style="float:right; font-size: 80%; position: relative; top:-10px"><a href="https://facebook.com/<?=$config['facebook_author']?>" target="_blank">Butuh Akun?</a></div> </div> <div style="padding-top:30px" class="panel-body" > <form method="post" action="userlogin.php" id="loginform" class="form-horizontal"> <div id="salsakp" class="input-group col-sm-12"></div> <div style="margin-bottom: 20px" class="input-group"> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <input type="text" name="username" id="username" placeholder="Username" class="form-control" required="required"> </div> <div style="margin-bottom: 20px" class="input-group"> <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span> <input type="password" name="password" id="password" placeholder="Password" class="form-control" required="required"> </div> <div style="margin-top:30px" class="form-group"> <div class="col-sm-12 controls"> <button id="btn-login" type="submit" href="#" class="form-control btn btn-info">Masuk</button> </div> </div> </form> </div> </div> </div> </div> <? else: ?> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="panel panel-info" > <div class="panel-heading"> <div class="panel-title">Submit Like</div> </div> <div class="panel-body"> <div class="row"> <div class="col-lg-12"> <div class="text-center"> <h3 style="color:blue;"><?=$config['title']?></h3> </div><hr> <div id="salsakp" class="form-group"></div> <form role="form" method="post" id="salsa" action="addlikes.php"> <div class="form-group"> <label>URL Foto</label> <input class="form-control" name="url" id="url" required="required" placeholder="https://instagram.com/p/36awObvWK6/"> </div> <div class="form-group"> <label>Jumlah Submit</label> <input type="number" class="form-control" name="jumlah" id="jumlah" required="required" placeholder="500"> </div> <div class="form-group"> <button type="submit" id="btn-login" class="btn btn-info">Submit</button> <button type="reset" class="btn btn-default">Reset</button> </div> </form><hr></div> </div></div></div></div> <div class="col-md-12"> <div class="panel panel-info" > <div class="panel-heading"> <div class="panel-title">Submit Followers</div> </div> <div class="panel-body"> <div class="row"> <div class="col-lg-12"> <div class="text-center"> <h3 style="color:blue;"><?=$config['title']?></h3> </div><hr> <div id="salsakp2" class="form-group"></div> <form role="form" method="post" id="skp" action="addfollowers.php"> <div class="form-group"> <label>Username</label> <input class="form-control" name="username" id="username" required="required" placeholder="haqqny"> </div> <div class="form-group"> <label>Jumlah Submit</label> <input type="number" class="form-control" name="jumlah" id="jumlah2" required="required" placeholder="500"> </div> <div class="form-group"> <button type="submit" id="btn-login2" class="btn btn-info">Submit</button> <button type="reset" class="btn btn-default">Reset</button> </div> </form><hr></div> </div></div></div></div> <div class="col-md-12"> <div class="panel panel-info" > <div class="panel-heading"> <div class="panel-title">Submit Comments</div> </div> <div class="panel-body"> <div class="row"> <div class="col-lg-12"> <div class="text-center"> <h3 style="color:blue;"><?=$config['title']?></h3> </div><hr> <div id="salsakp3" class="form-group"></div> <form role="form" method="post" id="skp2" action="addcomments.php"> <div class="form-group"> <label>URL Foto</label> <input class="form-control" name="url" id="url3" required="required" placeholder="https://instagram.com/p/36awObvWK6/"> </div> <div class="form-group"> <label>List Comments</label> <textarea class="form-control" rows="4" cols="50" name="comment" placeholder="GJ" id="comment"></textarea> </div> <div class="form-group"> <button type="submit" id="btn-login3" class="btn btn-info">Submit</button> <button type="reset" class="btn btn-default">Reset</button> </div> </form><hr></div> </div></div></div></div></div></div> <? endif; ?> <script src="assets/js/jquery.min.js"></script> <script> <? if(!$_SESSION['account']): ?> $(document).ready(function(){ $('#username').focus(); $("form#loginform").submit(function () { if($('#username').val().length>3||$('#password').val.length>3){ var pdata = $(this).serialize(); var purl = $(this).attr('action'); $.ajax({ url:purl, data:pdata, timeout:false, type:'POST', dataType:'JSON', success:function(hasil){ $("input").removeAttr("disabled", "disabled"); $("button").removeAttr("disabled", "disabled"); $("#btn-login").html('Masuk'); if(hasil.result){ window.location.replace(hasil.redirect); $("#salsakp").html('<div class="alert alert-success" role="alert">'+hasil.content+'</div>'); }else $("#salsakp").html('<div class="alert alert-warning" role="alert">'+hasil.content+'</div>'); },error: function (a, b, c) { $("input").removeAttr("disabled", "disabled"); $("button").removeAttr("disabled", "disabled"); $("#btn-login").html('Masuk'); $("#salsakp").html('<div class="alert alert-warning" role="alert">'+c+'</div>'); },beforeSend:function() { $("input").attr("disabled", "disabled"); $("#btn-login").html('Loading..'); $("#salsakp").html(''); $("button").attr("disabled", "disabled"); } }); } return false });}); <? else: ?> $(document).ready(function(){ $('#url').focus(); $("form#salsa").submit(function () { if($('#url').val().length>30||$('#jumlah').val.length>0){ var pdata = $(this).serialize(); var purl = $(this).attr('action'); $.ajax({ url:purl, data:pdata, timeout:false, type:'POST', dataType:'JSON', success:function(hasil){ $("input").removeAttr("disabled", "disabled"); $("button").removeAttr("disabled", "disabled"); $("#btn-login").html('Submit'); if(hasil.result) $("#salsakp").html('<div class="alert alert-success" role="alert">'+hasil.content+'</div>'); else $("#salsakp").html('<div class="alert alert-warning" role="alert">'+hasil.content+'</div>'); },error: function (a, b, c) { $("input").removeAttr("disabled", "disabled"); $("button").removeAttr("disabled", "disabled"); $("#btn-login").html('Submit'); $("#salsakp").html('<div class="alert alert-warning" role="alert">'+c+'</div>'); },beforeSend:function() { $("input").attr("disabled", "disabled"); $("#btn-login").html('Loading..'); $("#salsakp").html(''); $("button").attr("disabled", "disabled"); } }); } return false }); $("form#skp").submit(function () { if($('#username').val().length>2||$('#jumlah2').val.length>0){ var pdata = $(this).serialize(); var purl = $(this).attr('action'); $.ajax({ url:purl, data:pdata, timeout:false, type:'POST', dataType:'JSON', success:function(hasil){ $("input").removeAttr("disabled", "disabled"); $("button").removeAttr("disabled", "disabled"); $("#btn-login2").html('Submit'); if(hasil.result) $("#salsakp2").html('<div class="alert alert-success" role="alert">'+hasil.content+'</div>'); else $("#salsakp2").html('<div class="alert alert-warning" role="alert">'+hasil.content+'</div>'); },error: function (a, b, c) { $("input").removeAttr("disabled", "disabled"); $("button").removeAttr("disabled", "disabled"); $("#btn-login2").html('Submit'); $("#salsakp2").html('<div class="alert alert-warning" role="alert">'+c+'</div>'); },beforeSend:function() { $("input").attr("disabled", "disabled"); $("#btn-login2").html('Loading..'); $("#salsakp2").html(''); $("button").attr("disabled", "disabled"); } }); } return false }); $("form#skp2").submit(function () { if($('#url3').val().length>2||$('#comment').val.length>3){ var pdata = $(this).serialize(); var purl = $(this).attr('action'); $.ajax({ url:purl, data:pdata, timeout:false, type:'POST', dataType:'JSON', success:function(hasil){ $("input").removeAttr("disabled", "disabled"); $("button").removeAttr("disabled", "disabled"); $("#btn-login3").html('Submit'); if(hasil.result) $("#salsakp3").html('<div class="alert alert-success" role="alert">'+hasil.content+'</div>'); else $("#salsakp3").html('<div class="alert alert-warning" role="alert">'+hasil.content+'</div>'); },error: function (a, b, c) { $("input").removeAttr("disabled", "disabled"); $("button").removeAttr("disabled", "disabled"); $("#btn-login3").html('Submit'); $("#salsakp3").html('<div class="alert alert-warning" role="alert">'+c+'</div>'); },beforeSend:function() { $("input").attr("disabled", "disabled"); $("#btn-login3").html('Loading..'); $("#salsakp3").html(''); $("button").attr("disabled", "disabled"); } }); } return false });}); <? endif; ?> </script> <? include('footer.php'); ?>
Verilmiş cavablar və yazılan şərhlər (2 cavab var)
1
Ilk öncə deyim ki kod çox pisdir. Javascript php-yə qarışıb, php html-ə. Belə olmaz. Bunları səliqə sahmanla ayırmaq lazımdır. Yoxsa əlbəttə baş çıxarmaq olmaz səhv hardadır.
Shorttag-lar əvəzinə <?php tam teqlər istifadə edin düzələcək. Sizdə bu kodda problem onların istifadəsi ilə bağlıdır.
0
Çox sağolun Müəllim təşəkkürlər düzəldi.
Sual verin
Cavab verin