“Skrip php” Kode Jawaban

skrip di dalam php

<?php
    if(isset($_POST['btn'])){
        //do some task
    ?>
    <script type="text/javascript">
        var e = document.getElementById('testForm'); e.action='test.php'; e.submit();</script>
    <?php
    }
    ?>
<form name="testForm" id="testForm"  method="POST"  >
    <input type="submit" name="btn" value="submit" autofocus  onclick="return true;"/>
 </form>
Grieving Gerbil

Skrip php


You may want to know that removing semicolon is optional sometime but need to know the condition when it can be removed and when it can't be.
-------------------------------------------------------------------------
// Example 1: PHP script with closing tag at the end.
<?php

// php code

// you can remove semicolon
mysqli_close( $db )
?>

// Example 2: PHP script without closing tag at the end.
<?php

// php code 

// you can't remove semicolon
mysqli_close( $db )

-----------------------------------------------------------------------

claude61340

Jawaban yang mirip dengan “Skrip php”

Pertanyaan yang mirip dengan “Skrip php”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya