Skip to main content

Posts

PHP#4 form_get.php | xuly_form_get.php

//form_get.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="get" action="xuly_form_get.php"> <label for="test">Nhập giá trị:</label> <input type="text" name="test" id="test"> <input type="submit" name="submit" id="submit" value="Thực hiện"> </form> <p>Click vào <a href="xuly_form_get.php?test=123">đây</a> để test</p> </body> </html> //xuly_form_get.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php if(isset($_GET['test'])) { echo $_GET['test']; //echo "<br/>".$_GET['submi...

PHP#4 post_bt3 //Tạo form cho phép người dùng nhập vào số dòng, số cột và nút thực hiện. Khi người dùng click nút thực hiện, dữ liệu trên form sẽ truyền qua file xử lý và hiển thị 1 bảng có số dòng, số cột tương ứng.

  <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body > <?php /* Tạo form cho phép người dùng nhập vào số dòng, số cột và nút thực hiện. Khi người dùng click nút thực hiện, dữ liệu trên form sẽ truyền qua file xử lý và hiển thị 1 bảng có số dòng, số cột tương ứng. */ ?> <?php if(isset($_POST['dong'],$_POST['cot'])) { $d=$_POST['dong']; $c=$_POST['cot']; $m=$_POST['mau']; echo "<table border='1' width='80%' bgcolor='$m'>"; for($i=1;$i<=$d;$i++) { echo "<tr>"; for($j=1;$j<=$c;$j++) echo "<td>&nbsp;</td>"; echo "</tr>"; } echo "</table>"; } else { ?> <form id="form1" name="form1" method="post" action=""> <p> <lab...

PHP#4 post_bt2.php | post_bt2_xuly.php //Tạo form cho phép người dùng nhập vào số dòng, số cột và nút thực hiện. Khi người dùng click nút thực hiện, dữ liệu trên form sẽ truyền qua file xử lý và hiển thị 1 bảng có số dòng, số cột tương ứng.

//post_bt2.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php /* Tạo form cho phép người dùng nhập vào số dòng, số cột và nút thực hiện. Khi người dùng click nút thực hiện, dữ liệu trên form sẽ truyền qua file xử lý và hiển thị 1 bảng có số dòng, số cột tương ứng. */ ?> <form id="form1" name="form1" method="post" action="post_bt2_xuly.php"> <p> <label for="dong">Số dòng:</label> <input type="text" name="dong" id="dong"> </p> <p> <label for="cot">Số cột:</label> <input type="text" name="cot" id="cot"> </p> <p> <input type="submit" name="taobang" id="taobang" value="Tạo bảng"> </p> </f...

PHP#4 form_post.php | xuly_form_post.php

 //form_post.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action="xuly_form_post.php"> <label for="test">Nhập giá trị:</label> <input type="text" name="test" id="test"> <input type="submit" name="submit" id="submit" value="Thực hiện"> </form> </body> </html> //xuly_form_post.php <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php if(isset($_POST['test'])) { echo $_POST['test']; echo "<br/>".$_POST['submit']; } else echo "Bạn phải thực hiện từ form!" ?> </body> </html...