Ive made a search page. It displays the name of the users which is the result of search. Now i want that if we click on the name it should open another page in which the profile of the user will be displayed. The code that i ve done till now, only works for the last user in the list of users displayed and it also doesnt opens in another window. I think the name of the users should be passed as an array to the account page where profile is displayed. But i was not able to do it. Plz help. Ive given the relevant code below plz let me know what is the problem.
search.php
Expand|Select|Wrap|Line Numbers
- if($resultnum>0) { // Echos out matches if anything was found
- while($info=mysql_fetch_array($data)){
- //Print it out to page
- ?><a href="searchaccount.php">
- <?php
- $_SESSION['username'] = $info['UserName'];
- echo "".$info['UserName'] . " <BR><BR>" ?></a>
- <?php
- }// end of while
- }//end of if
- else{
- echo "There are no results to be displayed for your search";
- }
Expand|Select|Wrap|Line Numbers
- $uname = $_SESSION['username'];
- $result1= " SELECT UserName, EmailAddress, FullName FROM usermaster WHERE UserName= '$uname'";
- $data1 = mysql_query($result1) or die(mysql_error());