I have in header.php
(which is the header of each page) a search form.
After form submission I want to redirect users to page: site.com/search-$VALUE-100
.
I've tried with:
$value = $_POST['value'];
if(isset($_POST['search']))
{
if(preg_match('/^[a-zA-Z0-9]$/', $value))
{
header("Location: search-".$value."-100");
}
}
and HTML:
<form method="get">
<input type="text" name="value" value="search" onfocus="if (this.value==this.defaultValue) this.value = ''" onblur="if (this.value=='') this.value = this.defaultValue" />
<input type="submit" name="search" class="image" value="" />
</form>
Now code sent to:
page.php?value=a&search=
index.php?value=a&search=
user.php?value=a&search=
somepage.php?value=a&search=