1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

jQuery/Ajax - Get the value of a hyperlink.

Discussion in 'jQuery' started by cancer10, Jul 28, 2008.

  1. #1
    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
    
    
    Code (markup):


    The result on the search.php page will output as the following :

    Search Results:
    - Sam Thomas => sam
    - John Clinger => jon
    - Patrick Norton => 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
     
    cancer10, Jul 28, 2008 IP