Hi,
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
[code=php]
if($resultnum>0 ) { // Echos out matches if anything was found
while($info=mys ql_fetch_array( $data)){
//Print it out to page
?><a href="searchacc ount.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";
}
[/code]
searchaccount.p hp
[code=php]
$uname = $_SESSION['username'];
$result1= " SELECT UserName, EmailAddress, FullName FROM usermaster WHERE UserName= '$uname'";
$data1 = mysql_query($re sult1) or die(mysql_error ());
[/code]
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
[code=php]
if($resultnum>0 ) { // Echos out matches if anything was found
while($info=mys ql_fetch_array( $data)){
//Print it out to page
?><a href="searchacc ount.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";
}
[/code]
searchaccount.p hp
[code=php]
$uname = $_SESSION['username'];
$result1= " SELECT UserName, EmailAddress, FullName FROM usermaster WHERE UserName= '$uname'";
$data1 = mysql_query($re sult1) or die(mysql_error ());
[/code]
Comment