
June 4th, 2002, 12:49 AM
|
|
Junior Member
|
|
Join Date: Jun 2002
Location: Banas Dairy,Palanpur
Posts: 0
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
How to store mulitiselected value in php
Dear Sir,
I had made web application using php and postgresql. I want to use
mulitple selection box. Please send me how can i know where user select
mulitple value and submit form. Because I have to store all selected
values.
I had asp code which is pasted below but for php what is coding i
donot
know plese help me.
mail at : URL, URL
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 %>
<HTML>
<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")(theNumberOfOccupation
s) %>
<END IF>
.</P>
<P><A HREF="next.htm">Next</A></P>
</BODY>
</HTML>
waiting for favourable reply, Bye...
regards, bakul
|