cancer10
07-29-2008, 08:35 AM
Hi All,
I have a search user option on my webpage (search.php) where people can search for a product. The processing part is done on a separate php page (process.php)
The code for process.php page is:
if($_GET['action']=='search_user'){
$name = $_GET['txtnamesearch'];
$result = mysql_query("select username,full_name from login where username LIKE'$name%' or full_name LIKE'$name%'");
$num_rows = count($result);
if($num_rows<1)
echo "<B>Oouchhh!! Try refining your search.</b>";
else{
for($x=0;$x<$num_rows;$x++){
echo '- '.$result[$x]['full_name'] .' => <a id='.$result[$x]['username'].'>'. $result[$x]['username']. '</a><BR>';
}
}
}//End Search User
The result on the search.php page will output as the following :
Search Results:
- Sam Thomas => sam (process.php?user=sam)
- John Clinger => jon (process.php?user=jon)
- Patrick Norton => pat (process.php?user=pat)
Now, I want such that clicking on each username would display their profile details.
What ajax call do I have to make and how?
Thanx
I have a search user option on my webpage (search.php) where people can search for a product. The processing part is done on a separate php page (process.php)
The code for process.php page is:
if($_GET['action']=='search_user'){
$name = $_GET['txtnamesearch'];
$result = mysql_query("select username,full_name from login where username LIKE'$name%' or full_name LIKE'$name%'");
$num_rows = count($result);
if($num_rows<1)
echo "<B>Oouchhh!! Try refining your search.</b>";
else{
for($x=0;$x<$num_rows;$x++){
echo '- '.$result[$x]['full_name'] .' => <a id='.$result[$x]['username'].'>'. $result[$x]['username']. '</a><BR>';
}
}
}//End Search User
The result on the search.php page will output as the following :
Search Results:
- Sam Thomas => sam (process.php?user=sam)
- John Clinger => jon (process.php?user=jon)
- Patrick Norton => pat (process.php?user=pat)
Now, I want such that clicking on each username would display their profile details.
What ajax call do I have to make and how?
Thanx