Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: RE:_[pro_php]_How_cantī_read_the_names_and_values_off_a_combo-box


Message #1 by =?iso-8859-1?q?Julio=20Oliveira?= <oliveira_julio@y...> on Thu, 21 Jun 2001 12:06:53 +1000 (EST)
Hi
your spanish is better than my english

Donīt worry i understand english from 40 years ago,
but i donīt write very good.

This is the problem.

Iīm doing a web e-commerce.
I have the client at the browser, and he has to do the
new client.

Name ....  julio
direc....  Gaona 3456 - 
city ................  (hear the problem)

He has to select from a list 

Buenos Aires 
Capital
New York

I donīt want he see the numbers off the city that are
at the server (mysql - table)

At mysql-table i have a number like the key

0001BuenosAires  ( a number and the first six
elements)
                  and the last six elements for
security)

When i take the listbox at the browser i donīt like to
see the numbers off the key. He only see the names.

When he take one at the browser, like Buenos Aires, y
see that at the text in the browser, but i have to put
the number at the table off the client.

I do that with clipper at dos without problem.

Canīt i have an array bidimensional (name and number)
and see only the name at the listbox in the browse.

Sorry by the lata (charla muy larga)
contestame en ingles o en espaņol, si es espaņol mejor
para que tu pratiques.

Muchas gracias por tu tiempo

Saludos
Julio Oliveira - Buenos Aires - Argentina.



--- Nikolai Devereaux <yomama@u...> wrote: > Que
pasa,
> 
> Lo siento, pero mi Espanol no esta tan bueno. =)
> 
> Lo que yo no comprendo es si quieres solamente un
> numero, o si quieres la
> nombre de la ciudad y el numero tambien.  Hay un
> numero distinto para cada
> ciudad?  Estas usiendo una database?
> 
> Si cada ciudad tiene un numero distinto, yo pienso
> que es mejor si pases
> solamente el numero con la forma.
> 
> <form method="post"
> action="http://www.name.com/page.php">
>   <select name="cities">
>     <option value="1">San Diego</option>
>     <option value="2">Athens</option>
>     <option value="3">Buenos Aires</option>
>   </select>
> </form>
> 
> Si estas usando una database, puedes usar PHP para
> ... como se dice... query
> el database para todos las ciudades y numeros, y
> cree la forma en un
> while-loop.
> 
> <form ...>
>   <select name="city">
> <?php
>     $resultset = mysql_query("SELECT num, name FROM
> cities");
> 
>     while($nextCity = mysql_fetch_assoc($resultset))
>     {
>         echo "<option value='" . $nextCity[num] .
> "'>" . $nextCity[name] .
> "</option>\n";
>     }
> ?>
>   </select>
> </form>
> 
> Entonces, en "page.php", donde la forma envia la
> data, puedes usar el numero
> ($city) para query el database otra vez y sacar el
> nombre de la ciudad.
> 
> Buena suerte,
> 
> Nik
> 
> ----- just in case... -----
> 
> What's happening,
> 
> I'm sorry, but my spanish isn't that great. =)
> 
> What I don't understand is whether you want just a
> number, or if you want
> the name of the city and the number also.  Is there
> a distinct number for
> each city?  Are you using a database?
> 
> If each city has it's own number, I think that it'd
> be better to just pass
> the number with the form.
> 
> -- code --
> 
> If you're using a database, you can use PHP to query
> the database for all
> the cities and numbers, and create the form in a
> while loop.
> 
> -- code --
> 
> Then, in page.php, where the form sends the data,
> you can use the number
> ($city) to query the database again and get the name
> of the city.
> 
> Good luck,
> 
> Nik
> 
> > -----Original Message-----
> > From: Julio Oliveira
> [mailto:oliveira_julio@y...]
> > Sent: Tuesday, June 19, 2001 7:02 PM
> > To: professional php
> > Subject: [pro_php] How cantī read the names and
> values off a combo-box
> >
> >
> > Sorry by my english
> >
> > I'm doing a web page, with combo-box off same
> data.
> >
> > I need to know wich record the client get, how to
> take
> > the value and name off the selection see that.
> >
> > Como-box  at the browser
> >
> > City         Buenos Aires
> >              Capital        --- >  they take this
> >              Cordoba
> >
> > I need the name, and a hiden value that is a
> number
> > off city perhaps  15.-
> >
> > Thanks to all sorry by my english
> >
> > Julio Oliveira - Buenos Aires Argentina.


  Return to Index