30/09/2018, 20:39

Từ file Search.php, điền một tỉnh sau khi ấn Submit thì được get sang bên file solution.php một huyện tương ứng thì em phải code như nào?

Em có đoạn code như sau, em nhờ các anh xem giúp em lỗi và tư vấn luôn giúp em một chút được không ạ ?

Em muốn hỏi là từ file Search.php e, điền một tỉnh sau khi ấn Submit thì được get sang bên file solution.php một huyện tương ứng thì em phải code như nào anh ?
Anh chị có thể Code ví dụ giúp em 1-2 tỉnh được không ạ ?
Em xin cảm ơn !

Search.php

<!DOCTYPE html>
<html>
   <head>
      <title>LỖI PHẦN MỀM GXD</title>
      <style>
         body {
         background: #eee;
         font: 12px Arial, Helvetica;
         color: #333;
         text-align: center;}
         a {
         color: #2A679F;}
         /*-------------------------------------*/   
         .form-wrapper {
         width: 450px;
         padding: 8px;
         margin: 100px auto;
         overflow: hidden;
         border-width: 1px;
         border-style: solid;
         border-color: #dedede #bababa #aaa #bababa;
         -moz-box-shadow: 0 3px 3px rgba(255,255,255,.1), 0 3px 0 #bbb, 0 4px 0 #aaa, 0 5px 5px #444;
         -webkit-box-shadow: 0 3px 3px rgba(255,255,255,.1), 0 3px 0 #bbb, 0 4px 0 #aaa, 0 5px 5px #444;
         box-shadow: 0 3px 3px rgba(255,255,255,.1), 0 3px 0 #bbb, 0 4px 0 #aaa, 0 5px 5px #444;
         -moz-border-radius: 10px;
         -webkit-border-radius: 10px;
         border-radius: 10px;    
         background-color: #f6f6f6;
         background-image: -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#eae8e8)); 
         background-image: -webkit-linear-gradient(top, #f6f6f6, #eae8e8);
         background-image: -moz-linear-gradient(top, #f6f6f6, #eae8e8);
         background-image: -ms-linear-gradient(top, #f6f6f6, #eae8e8);
         background-image: -o-linear-gradient(top, #f6f6f6, #eae8e8);
         background-image: linear-gradient(top, #f6f6f6, #eae8e8);  }    
         .form-wrapper #search {
         width: 330px;
         height: 20px;
         padding: 10px 5px;
         float: left;    
         font: bold 16px 'lucida sans', 'trebuchet MS', 'Tahoma';
         border: 1px solid #ccc;
         -moz-box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
         -webkit-box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
         box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
         -moz-border-radius: 3px;
         -webkit-border-radius: 3px;
         border-radius: 3px; }   
         .form-wrapper #search:focus {
         outline: 0; 
         border-color: #aaa;
         -moz-box-shadow: 0 1px 1px #bbb inset;
         -webkit-box-shadow: 0 1px 1px #bbb inset;
         box-shadow: 0 1px 1px #bbb inset; }
         .form-wrapper #search::-webkit-input-placeholder {
         color: #999;
         font-weight: normal;}   
         .form-wrapper #search:-moz-placeholder {
         color: #999;
         font-weight: normal;}
         .form-wrapper #search:-ms-input-placeholder {
         color: #999;
         font-weight: normal; }       
         .form-wrapper #submit {
         float: right;    
         border: 1px solid #00748f;
         height: 42px;
         width: 100px;
         padding: 0;
         cursor: pointer;
         font: bold 15px Arial, Helvetica;
         color: #fafafa;
         text-transform: uppercase;    
         background-color: #0483a0;
         background-image: -webkit-gradient(linear, left top, left bottom, from(#31b2c3), to(#0483a0));
         background-image: -webkit-linear-gradient(top, #31b2c3, #0483a0);
         background-image: -moz-linear-gradient(top, #31b2c3, #0483a0);
         background-image: -ms-linear-gradient(top, #31b2c3, #0483a0);
         background-image: -o-linear-gradient(top, #31b2c3, #0483a0);
         background-image: linear-gradient(top, #31b2c3, #0483a0);
         -moz-border-radius: 3px;
         -webkit-border-radius: 3px;
         border-radius: 3px;      
         text-shadow: 0 1px 0 rgba(0, 0 ,0, .3);
         -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 0 #fff;
         -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 0 #fff;
         box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 0 #fff;  }     
         .form-wrapper #submit:hover,
         .form-wrapper #submit:focus {		
         background-color: #31b2c3;
         background-image: -webkit-gradient(linear, left top, left bottom, from(#0483a0), to(#31b2c3));
         background-image: -webkit-linear-gradient(top, #0483a0, #31b2c3);
         background-image: -moz-linear-gradient(top, #0483a0, #31b2c3);
         background-image: -ms-linear-gradient(top, #0483a0, #31b2c3);
         background-image: -o-linear-gradient(top, #0483a0, #31b2c3);
         background-image: linear-gradient(top, #0483a0, #31b2c3);}	     
         .form-wrapper #submit:active {
         outline: 0;    
         -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
         -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
         box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset; }    
         .form-wrapper #submit::-moz-focus-inner {
         border: 0;
         }
      </style>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   </head>
   <body>
      <form class="form-wrapper" name='register' action='solution.php' method='post'>
         <input type="text" id="search" placeholder="Tìm kiếm" required>
         <input type="submit" value="Tìm kiếm" id="submit">
      </form>
   </body>
</html>

solution.php

<!DOCTYPE html>
<html>
   <head>
      <title>LỖI PHẦN MỀM GXD</title>
      <style>
         body {
         background: #eee;
         font: 12px Arial, Helvetica;
         color: #333;
         text-align: center;}
         a {
         color: #2A679F;}
         /*-------------------------------------*/   
         .form-wrapper {
         width: 450px;
         padding: 8px;
         margin: 100px auto;
         overflow: hidden;
         border-width: 1px;
         border-style: solid;
         border-color: #dedede #bababa #aaa #bababa;
         -moz-box-shadow: 0 3px 3px rgba(255,255,255,.1), 0 3px 0 #bbb, 0 4px 0 #aaa, 0 5px 5px #444;
         -webkit-box-shadow: 0 3px 3px rgba(255,255,255,.1), 0 3px 0 #bbb, 0 4px 0 #aaa, 0 5px 5px #444;
         box-shadow: 0 3px 3px rgba(255,255,255,.1), 0 3px 0 #bbb, 0 4px 0 #aaa, 0 5px 5px #444;
         -moz-border-radius: 10px;
         -webkit-border-radius: 10px;
         border-radius: 10px;    
         background-color: #f6f6f6;
         background-image: -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#eae8e8)); 
         background-image: -webkit-linear-gradient(top, #f6f6f6, #eae8e8);
         background-image: -moz-linear-gradient(top, #f6f6f6, #eae8e8);
         background-image: -ms-linear-gradient(top, #f6f6f6, #eae8e8);
         background-image: -o-linear-gradient(top, #f6f6f6, #eae8e8);
         background-image: linear-gradient(top, #f6f6f6, #eae8e8);  }    
         .form-wrapper #search {
         width: 330px;
         height: 20px;
         padding: 10px 5px;
         float: left;    
         font: bold 16px 'lucida sans', 'trebuchet MS', 'Tahoma';
         border: 1px solid #ccc;
         -moz-box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
         -webkit-box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
         box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
         -moz-border-radius: 3px;
         -webkit-border-radius: 3px;
         border-radius: 3px; }   
         .form-wrapper #search:focus {
         outline: 0; 
         border-color: #aaa;
         -moz-box-shadow: 0 1px 1px #bbb inset;
         -webkit-box-shadow: 0 1px 1px #bbb inset;
         box-shadow: 0 1px 1px #bbb inset; }
         .form-wrapper #search::-webkit-input-placeholder {
         color: #999;
         font-weight: normal;}   
         .form-wrapper #search:-moz-placeholder {
         color: #999;
         font-weight: normal;}
         .form-wrapper #search:-ms-input-placeholder {
         color: #999;
         font-weight: normal; }       
         .form-wrapper #submit {
         float: right;    
         border: 1px solid #00748f;
         height: 42px;
         width: 100px;
         padding: 0;
         cursor: pointer;
         font: bold 15px Arial, Helvetica;
         color: #fafafa;
         text-transform: uppercase;    
         background-color: #0483a0;
         background-image: -webkit-gradient(linear, left top, left bottom, from(#31b2c3), to(#0483a0));
         background-image: -webkit-linear-gradient(top, #31b2c3, #0483a0);
         background-image: -moz-linear-gradient(top, #31b2c3, #0483a0);
         background-image: -ms-linear-gradient(top, #31b2c3, #0483a0);
         background-image: -o-linear-gradient(top, #31b2c3, #0483a0);
         background-image: linear-gradient(top, #31b2c3, #0483a0);
         -moz-border-radius: 3px;
         -webkit-border-radius: 3px;
         border-radius: 3px;      
         text-shadow: 0 1px 0 rgba(0, 0 ,0, .3);
         -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 0 #fff;
         -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 0 #fff;
         box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 0 #fff;  }     
         .form-wrapper #submit:hover,
         .form-wrapper #submit:focus {		
         background-color: #31b2c3;
         background-image: -webkit-gradient(linear, left top, left bottom, from(#0483a0), to(#31b2c3));
         background-image: -webkit-linear-gradient(top, #0483a0, #31b2c3);
         background-image: -moz-linear-gradient(top, #0483a0, #31b2c3);
         background-image: -ms-linear-gradient(top, #0483a0, #31b2c3);
         background-image: -o-linear-gradient(top, #0483a0, #31b2c3);
         background-image: linear-gradient(top, #0483a0, #31b2c3);}	     
         .form-wrapper #submit:active {
         outline: 0;    
         -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
         -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
         box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset; }    
         .form-wrapper #submit::-moz-focus-inner {
         border: 0;
         }
      </style>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   </head>
   <body>
      <?php
         $search = $_POST['search'];
         $equal = "http://Link.html";
         ?>
      <form class="form-wrapper" name='register' action='solution.php' method='post'>
         <input type="text" id="search" value="<?php echo $equal;?>" placeholder="Kết quả" required>
         <input type="submit" value="Copy link" id="submit">
      </form>
   </body>
</html>
Hoàng Long viết 22:50 ngày 30/09/2018

Post code lên chứ , có mỗi cáo form thì ai mà chỉ được lỗi

MK viết 22:55 ngày 30/09/2018

Đã có code rồi mà anh @Hoang_Long

Bài liên quan
0