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
if($resultnum>0) { // Echos out matches if anything was found
while($info=mysql_fetch_array($data)){
//Print it out to page
$_SESSION['username'] = $info['UserName'];
echo "$info['UserName'] <a href=\"searchaccount.php?id=$info['UserName']\">profile</a><br/>";
}/ end of while
}//end of if
else{
echo "There are no results to be displayed for your search";
}
In this file i get an error as:
Quote:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\skill_search\search.php on line 181
searchaccount.php
CODE
$uname = $_SESSION['username'];
$un=$_GET['id'];
$result1= " SELECT UserName, EmailAddress, FullName FROM usermaster WHERE UserName= '$un'";
$data1 = mysql_query($result1) or die(mysql_error());
Plz help me with this
*edit*