I had used multiple selection box. Now when user select more than one value and submit form then if selection box name is sel1 then $sel1 has all selected value in array from but I donot know how to write code to get that value and know how many value is selected. I know in asp but for php how to write it please help me send me answer at : bakul@banas.guj.nic.in
or bakul_25@rediffmail.com
below code is asp code :
send me php code please.
Listing 35.3 multi.htm--One of the Fields of This Form May Have Multiple Values
<FORM METHOD="GET" ACTION="doMulti.asp">
<BR>First name: <INPUT TYPE="text" NAME="first">
<BR>Last name: <INPUT TYPE="text" NAME="last">
<BR>Occupation (select all that apply):
<SELECT NAME="Occupation" MULTIPLE SIZE=5>
<OPTION Executive>Executive
<OPTION Professional>Professional
<OPTION Engineer>Engineer
<OPTION Skilled>Skilled Labor
<OPTION Clerical>Clerical
</SELECT>
<BR><INPUT TYPE="submit" VALUE="Enter">
</FORM>
Listing 35.4 doMulti.asp--Use This ASP Script to Read the Values from "Occupation"
<%@ Language = VBScript %>
<HEAD><TITLE>Welcome</TITLE></HEAD>
<BODY>
<H1>Welcome</H1>
<P>Hello, <%= Request.QueryString("first") %>
<%= Request.QueryString("last") %> </P>
<P>Welcome to my site.</P>
<P>
<% theNumberOfOccupations = Request.QueryString("Occupation").Count %>
<% if theNumberOfOccupations = 0 %>
You must be unemployed
<% else if theNumberOfOccupations = 1 %>
Your occupation is
<% Request.QueryString("Occupation")(1) %>
<% else %>
Your occupations are
<% Request.QueryString("Occupation")(1) %>
<% For i = 2 to theNumberOfOccupations - 1 %>
,<% Request.QueryString("Occupation")(i) %>
<% Next %>
and <% Request.QueryString("Occupation")(theNumberOfOccupations) %>
<END IF>
.</P>
<P><A HREF="next.htm">Next</A></P>
</BODY>