Javascript onclick href

Bạn có thể gặp vấn đề khi nhấp vào một URL để truy cập trang X nhưng bạn lại được điều hướng đến trang Y. Nó xảy ra là do Chuyển hướng trang – Điều hướng lại trang. Các khái niệm này khác với. trang Làm mới JavaScript

Có nhiều lý do khác nhau để tại sao bạn muốn chuyển hướng người dùng từ trang ban đầu. Dưới đây là một số lý do

  • Bạn không thích tên miền của bạn và bạn đang muốn chuyển qua một tên miền mới. Trong trường hợp này, bạn có thể muốn điều hướng trực tiếp tất cả khách truy cập của bạn tới trang web mới. Tại đây, bạn có thể duy trì tên miền cũ, nhưng đặt một trang đơn với một hướng điều hướng lại trang để tất cả khách truy cập tên miền cũ có thể vào miền mới
  • Bạn đã xây dựng các trang khác nhau dựa trên trình duyệt hoặc tên của nó hoặc có thể dựa trên các quốc gia khác nhau, sau đó, thay vì sử dụng sự điều hướng lại trang ở Phía máy chủ, bạn có thể sử dụng
  • Công cụ tìm kiếm có thể lập chỉ mục các trang của bạn. Nhưng khi chuyển sang miền mới, bạn không muốn đánh mất những vị trí khách truy cập thông qua phương tiện tìm kiếm tiện ích. Vì thế bạn có thể sử dụng điều hướng lại trang ở Client-Side. Nhưng bạn nên nhớ rằng điều này không nên được thực hiện để lừa dối Công cụ Tìm kiếm, nó có thể cho trang của bạn thành trang bị cấm

Chuyển hướng trang làm việc như thế nào?

Qui trình thực hiện Chuyển hướng trang như sau

Ví dụ 1

Nó khá đơn giản để thực hiện Chuyển hướng trang sử dụng JavaScript ở phía máy khách. Để điều hướng khách truy cập vào một trang mới, bạn chỉ cần thêm một dòng mã trong khu vực đầu như sau

<html>
   <head>

      <script type="text/javascript">
         <!--
            function Redirect() {
               window.location="https://viblo.asia.vn";
            }
         //-->
      </script>

   </head>

   <body>
      <p>Click the following button, you will be redirected to home page.</p>

      <form>
         <input type="button" value="Redirect Me" onclick="Redirect();" />
      </form>

   </body>
</html>

Ví dụ 2

Bạn có thể hiển thị một thông báo thích hợp cho khách truy cập trước khi điều hướng họ đến một trang mới. Điều này có thể cần một khoảng thời gian trì hoãn để tải trang mới. Ví dụ sau cách thực hiện tương tự. Tại đây, setTimeout() là một hàm có sẵn trong JavaScript mà có thể được sử dụng để thực hiện các lệnh khác sau một khoảng thời gian đã cho

<html>
   <head>

      <script type="text/javascript">
         <!--
            function Redirect() {
               window.location="https://viblo.asia.vn";
            }

            document.write("You will be redirected to main page in 10 sec.");
            setTimeout('Redirect()', 10000);
         //-->
      </script>

   </head>

   <body>
   </body>
</html>

Ví dụ 3

Ví dụ: chỉ cách điều hướng khách truy cập của bạn tới một trang khác dựa trên trình duyệt mà họ sử dụng

<html>
   <head>

      <script type="text/javascript">
         <!--
            var browsername=navigator.appName;
            if( browsername == "Netscape" )
            {
               window.location="http://www.location.com/ns.jsp";
            }
            else if ( browsername =="Microsoft Internet Explorer")
            {
               window.location="http://www.location.com/ie.jsp";
            }
            else
            {
               window.location="http://www.location.com/other.jsp";
            }
         //-->
      </script>

   </head>

   <body>
   </body>
</html>

Làm mới trang trong JavaScript

Bạn có thể làm mới một trang web bằng cách sử dụng vị trí phương thức. tải lại trong JavaScript. Mã này có thể được gọi tự động trên một sự kiện hoặc đơn giản khi người dùng nhấp vào một liên kết. Nếu bạn muốn làm mới một trang web bằng cách sử dụng cú nhấp chuột, bạn có thể sử dụng mã sau

<a href="javascript:location.reload(true)">Refresh Page</a>

Làm mới tự động

Bạn cũng có thể sử dụng JavaScript để làm mới trang một cách tự động sau một khoảng thời gian đã chọn. Ở đây, setTimeout() là một hàm có sẵn trong JavaScript mà có thể được sử dụng để thực thi hàm khác sau một khoảng thời gian đã chọn

Ví dụ Bạn thử ví dụ sau. Nó chỉ cách làm mới một trang sau mỗi 5 giây. You can change this time time by you

Thêm trang này vào trang PHP đầu tiên/chính, nơi bạn muốn gọi hành động từ đó, nhưng thay đổi nó từ thẻ

<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
20 tiềm năng (siêu liên kết) thành phần tử
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
21, vì vậy nó không được nhấp bởi bất kỳ bot hoặc bot nào

<head>
<script>
  // function invoking ajax with pure javascript, no jquery required.
  function myFunction(value_myfunction) {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
      if (this.readyState == 4 && this.status == 200) {
        document.getElementById("results").innerHTML += this.responseText; 
        // note '+=', adds result to the existing paragraph, remove the '+' to replace.
      }
    };
    xmlhttp.open("GET", "ajax-php-page.php?sendValue=" + value_myfunction, true);
    xmlhttp.send();
  }

</script>
</head>

<body>

  <?php $sendingValue = "thevalue"; // value to send to ajax php page. ?> 

  <!-- using button instead of hyperlink (a) -->
  <button type="button" onclick="value_myfunction('<?php echo $sendingValue; ?>');">Click to send value</button>

  <h4>Responses from ajax-php-page.php:</h4>
  <p id="results"></p> <!-- the ajax javascript enters returned GET values here -->

</body>

Khi nhấp vào

<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
21,
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
23 sử dụng chức năng JavaScript của Heads để gửi
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
24 qua AJAX đến một trang PHP khác, giống như nhiều ví dụ trước cái này. Trang khác,
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
25, kiểm tra giá trị nhận và trả lại cho
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
26

<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>

Phản hồi từ

<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
26 sau đó được trả lại và hiển thị với

<html>
   <head>

      <script type="text/javascript">
         <!--
            function Redirect() {
               window.location="https://viblo.asia.vn";
            }

            document.write("You will be redirected to main page in 10 sec.");
            setTimeout('Redirect()', 10000);
         //-->
      </script>

   </head>

   <body>
   </body>
</html>
4
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
1 dân cư và thêm vào các phần tử HTML hiện có, xóa
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
2 chỉ cập nhật và thay thế các nội dung hiện có của phần tử HTML
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
3
<?php

  $incoming = $_GET['sendValue'];

  if( isset( $incoming ) ) {
    print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
  } else {
    print_r("The request didn´t pass correctly through the GET...");
  }

?>
4

Xem thảo luận

Cải thiện bài viết

Lưu bài viết

  • Đọc
  • Bàn luận
  • Xem thảo luận

    Cải thiện bài viết

    Lưu bài viết

    Đọc

    Chức năng PHP bằng nút HTML. Tạo tài liệu biểu mẫu HTML chứa nút HTML. Khi nút được nhấp, phương thức viết bài được gọi. Phương thức bài viết mô tả cách gửi dữ liệu đến máy chủ. Sau khi click vào node, hàm Array_Key_Exists() được gọi. Tạo tài liệu biểu mẫu HTML có chứa nút HTML. Khi nút được nhấp, phương thức POST được gọi. Phương thức POST mô tả cách gửi dữ liệu đến máy chủ. Sau khi nhấp vào nút, hàm array_key_exists() được gọi

    Bàn luận

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    5
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    7
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    40
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    44
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    47
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    49
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    44
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    40
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    Chọn một tài liệu chứa mã HTML và PHP và nhiệm vụ được gọi là chức năng PHP sau khi nhấp vào nút. Có nhiều phương pháp khác nhau để giải quyết vấn đề này. Ngoài ra, ngoài việc làm điều này với một lần nhấn nút, một hàm PHP có thể được gọi bằng cách sử dụng Ajax, JavaScript và JQuery. Nhưng bài viết này chủ yếu tập trung vào cách tiếp cận nút định hướng của lệnh gọi hàm PHP

    Chương trình 1

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46______4211
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    215
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    218
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    47
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    49
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    218
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    239
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    240
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    242

    _______4243____4244

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46____4246
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    248

    _______4243____4250

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46____4246
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    254

    _______4243____4256

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46______4246
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    260
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    208
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    209
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    210
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    211
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46_______4246____142____4266
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    215
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    209
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    210
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    218
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    _______4243____4262

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6____4269
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    00
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    210
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    022

    Các

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    13___
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42____4201
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    269
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    40
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    Các

    đầu ra

    Javascript onclick href

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    13___

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    47
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8 Chương trình này sử dụng hàm isset() để gọi hàm PHP.
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    5
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    7
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    Chúng ta hãy xem xét các phương thức GET hoặc POST, vì hầu hết các nhà phát triển sử dụng phương thức POST thực hiện các vấn đề về quyền riêng tư, ví dụ sau chỉ dựa trên phương thức bài đăng

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    44
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    47
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    49
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    44
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    40
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    Chọn một tài liệu chứa mã HTML và PHP và nhiệm vụ được gọi là chức năng PHP sau khi nhấp vào nút. Có nhiều phương pháp khác nhau để giải quyết vấn đề này. Ngoài ra, ngoài việc làm điều này với một lần nhấn nút, một hàm PHP có thể được gọi bằng cách sử dụng Ajax, JavaScript và JQuery. Nhưng bài viết này chủ yếu tập trung vào cách tiếp cận nút định hướng của lệnh gọi hàm PHP

    Chương trình 1

    _______146
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    211
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    215
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    218
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    47
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    49
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    218
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    239
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    240
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6___1_____109_____4___42

    _______4243____4256

    _______146____4246____146
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    411

    _______4243____4262

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    46_______4246____142____4266
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    6
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    215
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    209
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    210
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    218
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    Các

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    13
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    17
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    210
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    19
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    20

    Các

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    13
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    17
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    210
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    36
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    20
    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    42
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    269
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201

    <html>
       <head>
    
          <script type="text/javascript">
             <!--
                function Redirect() {
                   window.location="https://viblo.asia.vn";
                }
    
                document.write("You will be redirected to main page in 10 sec.");
                setTimeout('Redirect()', 10000);
             //-->
          </script>
    
       </head>
    
       <body>
       </body>
    </html>
    
    40
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    201

    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    7
    <?php
    
      $incoming = $_GET['sendValue'];
    
      if( isset( $incoming ) ) {
        print_r("ajax-php-page.php recieved this: " . "$incoming" . "<br>");
      } else {
        print_r("The request didn´t pass correctly through the GET...");
      }
    
    ?>
    
    8

    đầu ra


    Làm cách nào để gọi chức năng PHP khi nhấp vào liên kết?

    Gọi chức năng PHP bằng nút HTML. Tạo tài liệu biểu mẫu HTML chứa nút HTML. Khi nút được nhấp, phương thức viết bài được gọi. Phương thức bài viết mô tả cách gửi dữ liệu đến máy chủ. Sau khi click vào node, hàm Array_Key_Exists() được gọi. Tạo tài liệu biểu mẫu HTML có chứa nút HTML. Khi bấm vào nút, phương thức POST được gọi. Phương thức POST mô tả cách gửi dữ liệu đến máy chủ. Sau khi nhấp vào nút, hàm array_key_exists() được gọi.

    Bạn có thể sử dụng onclick với PHP không?

    Tôi có thể sử dụng onclick trong PHP không? . PHP không có gì liên quan đến người dùng, tương tác trên màn hình. Vì vậy, chúng tôi không thể đặt sự kiện nhấp chuột trên JavaScript phía máy khách với chức năng PHP. chúng tôi không thể đặt sự kiện nhấp chuột của javascript phía máy khách bằng hàm PHP .

    Làm thế nào để bạn gọi một chức năng trong PHP?

    Có hai phương pháp để làm điều này. Một chức năng được gọi trực tiếp theo biến tên bằng cách sử dụng các khung và tham số và tên kia là bằng cách sử dụng hàm call_user_func () nhưng trong cả hai tên biến của phương thức sẽ được sử dụng. call_user_func ($ var);call_user_func ($ var1, "fun_function"); gọi hàm theo tên biến sử dụng dấu ngoặc và tham số và cách khác là sử dụng call_user_func . call_user_func( $var );

    Làm thế nào để bạn gọi một nút chức năng trong HTML?

    Để gọi chức năng này trong tài liệu HTML, chúng tôi phải tạo một nút đơn giản và sử dụng thuộc tính sự kiện Onclick (là trình xử lý sự kiện) cùng với nó, chúng tôi có thể gọi chức năng đó . tạo một nút đơn giản và sử dụng thuộc tính sự kiện onclick (là trình xử lý sự kiện) cùng với nó, chúng ta có thể gọi hàm bằng cách nhấp vào nút