Evacryption function



  • I don't know how to javascripte+php.

    <script>
    

    function fight(){
    <?php
    if($row['fight'] == 1){

    echo "setTimeout(function(){
    location.href='';
    }, 1000);";

    }
    else{

    }

    ?>

    }
    </script>


  • QA Engineer

    I-I would do that:

    <script>
    

    if ( '<?=$row['fight']?>' == 1 ) fight = Function.prototype;
    else {
    fight = function (){
    setTimeout( function(){ location.href=''; }, 1000);
    }
    }

    </script>

    But rather like this:

    <script>

    fightFlag = <?=( $row['fight'] != 1 )?>;
    fight = (
    fightFlag ?
    Function.prototype :
    function (){
    setTimeout( "location.href = '';", 1000);
    }
    );

    </script>




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2