如何在url中添加搜索值

Can someone help me insert the text user enters into the search form into the url?

For example: if user searches "the walking deads" it would look like this:

www.domain.com/search.php?=the+walking+deads/

This is my code:

    <?php
function connect($host,$username,$database,$password){
 $to_connect = mysql_connect($host,$username,$password) or die ("UNFinded ".$username. " DB !");
 $db = mysql_select_db($database, $to_connect) or die (mysql_error());
 return $db;
}
connect("localhost","idevice2_ariel","idevice2_ariel","ariel123456");

if (!isset($_POST['submit_form'])) {
    echo '<form name="search_form1" id="form" method="POST" action="search.php">
<input type="text" style="width: 300px; display: block; margin: 0 auto; height: 36px; text-align: center; font-size: 16px;" name="search_name" placeholder="חפש סרט או סדרה..." />
<input type="submit" value="Submit" name="submit_form" />
</form>';
} else {
       $search_name = $_POST['search_name'];
       $query = mysql_query("SELECT * FROM `members` WHERE (`moviename` like '%".$search_name."%')");
       $count = mysql_num_rows($query);
       while($row = mysql_fetch_array($query)) {
       $fname = $row['moviename'];
       $lname = $row['links'];
print '<a href="'.$row['links'].'">'.$row['moviename'].'</a><br />';
}
}
mysql_close($to_connect);
?>
<html>
<head>
<style type="text/css">
a {
padding:25px 560px;
    color: red;
}
</style>
</head>
<body>

</body>

</html>

$search_name is what user enters in the search input. now the url still only has the search file name.. Thanks!

Your form is sending datas via POST method ( <form ... method="POST">). If you want the data into your url, you should set method="GET". With this method, you will have to change your data retrieving from "$_POST['search_name'];" to "$_GET['search_name'];"

But WARNING, your data are raw, you have to validate, sanitize and escape them, otherwise anybody could try sql injection with this code.