0

Hello I am trying to figure out how to make secure Search engine or other types of POST and GET FORM.

this is example i have tried:

<?php

<!-- this $POST is the result to use on IF -->
$search_POST =stripcslashes(strip_tags(mysql_real_escape_string($_POST['keyword'])));

<!-- this $GET is the result to print on url -->
$search_GET = stripcslashes(strip_tags(mysql_real_escape_string($_GET['keyword'])));


if(here would like to detect url that contains tags and redirect with empty result and block the visitor){

$ip = $_SERVER['REMOTE_ADDR'];

$Action_block = mysql_query ("INSERT INTO BLOCK_HACKER VALUES ('','$ip','','')")or die("didn't work");

header ("Location: http://website.com");
exit();

} 





?>


<form action="<?php echo $_SERVER['PHP_SELF']; ?>"  method="POST"  >
<input type="text" id="search" class="" name="keyword" value="<?php echo $search_get1  ?>" placeholder="Find a Product" style="float:left; margin-bottom:10px;" >
<input type="button" name="submit23" id="submit23" value="" style="float:left; margin-left:-40px; margin-top:6px; height:24px; width:24px; background:url(<?php echo ''.$link_adress.'' ?>img/system/magnifyingglass.png); background-size:100% 100%; border:0; cursor:pointer; opacity:0.6;"  />
</form>

Can you guys help?

0 Answers0