I made a search form to get the profile of people whom i search the name with, the form is down here and it works
form file is named search.php
and output file is result.php
so literally the way the output link must be shown like
http://localhost/website/result.php?user=Name
but what i'm getting is http://localhost/website/result.php
which causes not to copy the profile link and show it to to others or apparently it doesnt work when i go to the first link [result.php?user=Name
],
which directs me to index.php
search.php
<form method="post" action="test.php">
<center><h3>YGG Live Player Stats</h3></center>
<h5>Enter Player name :<h5> <br/><br/><input type="text" name="search" size=50 maxlength=50><br/><br/>
<input type="Submit" name="Search" value="Search">
</form>
This is the result.php code down here, in which you could see index.php there is what it is actually taking me when i go to links like this http://localhost/website/result.php?user=Name
<?php
session_start();
if(isset($_POST['search']))
{
include "koneksi.php";
$query = $koneksi->prepare("SELECT * from `playerdata` where `user` = ?");
$query->execute(array($_POST['search']));
if($query->rowCount() > 0)
{
$data = $query->fetch();
?>
//html code here
<?php
}
else
{
go('index.php', 'Username not found!!!');
}
}
else
{
header("Location:index.php");
}
?>
How can i fix it?