<% if Request("flag")=1 then
		
nickname=Request("nickname")

session("online_sql")="select online.*,user.* from online,user where online.user_name=user.user_name and user.nickname='"&nickname&"'"

Response.Redirect "search_online.asp?move=1"
Response.End

   end if


	martial=Request("martial")

	place=Request("place")
	city=Request("city")
	income=Request("income")
	edu=Request("edu")
sql="select online.*,user.* from online,user where online.user_name=user.user_name and user.user_name like '%'"
		
'sql="select * from user where user_name like '%'"
if 	Request("sex")<>"0" then
sql=sql&" and user.sex='"&Request("sex")&"'"
end if
if Request("age_s")<>"" and Request("age_e")="" then
	max_byear=year(date)-Request("age_s")
	sql=sql&" and byear<'"&max_byear&"'"
elseif Request("age_s")="" and Request("age_e")<>"" then
	min_byear=year(date)-Request("age_e")
	sql=sql&" and byear>'"&min_byear&"'"
elseif Request("age_s")<>"" and Request("age_e")<>"" then
	if Request("age_s")<Request("age_e") then
		min_byear=year(date)-Request("age_e")
		max_byear=year(date)-Request("age_s")
	else
			min_byear=year(date)-Request("age_s")
		max_byear=year(date)-Request("age_e")
	end if
	sql=sql&" and byear>'"&min_byear&"'"
	sql=sql&" and byear<'"&max_byear&"'"

end if
if martial<>"0" then
	sql=sql&" and married='"&martial&"'"
end if


if place<>"0" then
	sql=sql&" and province='"&place&"'"
end if
if city<>"" then
	sql=sql&" and city='"&city&"'"
end if

if income<>"0" then
	sql=sql&" and salary='"&income&"'"
end if
if edu<>"0" then
	sql=sql&" and education='"&edu&"'"
end if	
session("online_sql")=sql
Response.Redirect "search_online.asp?move=1"
%>
