|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
select
I would like to save on HD the selected value in the select in this form.
Someone gave me the solution of $puntatore_file but it didn't go because I can't set the variable $sel which must take values from $CODICE and $DESCRIZIONE every time someone selects a value in this form I post the code : <?php include("dati.txt"); $link = mysql_connect ("$db_host") or die ("Non riesco a connettermi al server <b>$db_host</b><br>"); $table = "`aree omogenee`"; mysql_connect($db_host) or die("Impossibile collegarsi al server"); @mysql_select_db("$database") or die("Impossibile connettersi al database $database"); $sqlquery = "SELECT * FROM $table"; $result = mysql_query($sqlquery); $number = mysql_num_rows($result); $i = 0; if ($number < 1) { print "<CENTER><P>Non ci sono risultati nella tua ricerca</CENTER>"; } else { echo" <HTML> <HEAD> <STYLE TYPE=\"text/css\"> .select { font-family: Arial; color: #000000; font-size: 10px; font-weight: bold; border: 1px solid yellow; background-color: #c0ffc0; } </STYLE> <TITLE>Maschera AREE OMOGENEE </TITLE> </HEAD> <BODY> <FORM METHOD=post ACTION=\"\"> <INPUT TYPE=hidden NAME=formname VALUE=\"form test\"> <INPUT TYPE=hidden NAME=mailform_url VALUE=\"\"> <FONT face=arial size=5 color=#000000> <CENTER> <TABLE border=2 width=450 bgcolor=#00c000 bordercolor=#000000> <TR><TD> <TABLE border=0 width=450 bgcolor=#00c000> <TR><TD height=30></TD></TR> <TR><TD align=center><font face=arial size=4 color=#ff0000> Seleziona un valore dalla tabella</FONT><BR> <FONT face=arial size=4 color=#ff0000> <B>AREE OMOGENEE</B></FONT><BR> </TD></TR> <TR><TD height=10></TD></TR> <TR><TD align=center> <SELECT class=\"select\" size=1 cols=10 name=visualizza_dati> <OPTION selected VALUE=nessuna>"; while ($number > $i) { $CODICE = mysql_result($result,$i,"CODICE"); $DESCRIZIONE = mysql_result($result,$i,"DESCRIZIONE"); echo" <OPTION value=$CODICE $DESCRIZIONE>$DESCRIZIONE<br>"; $puntatore_file = fopen("C:/report/archivio.txt", "w"); $sel="$CODICE"; $fput=fputs($puntatore_file,$sel); fclose($puntatore_file); $i++; } } echo" </SELECT></td></tr> "; echo" <TR><TD align=center height=30></TD></TR> <TR><TD align=center> <INPUT TYPE=\"submit\" VALUE=\"Salva\" name=\"Submit\"></TD></TR> <TR><TD height=30></TD></TR> </TABLE> </table> </CENTER> </FORM> </BODY> </HTML>" ; ?> thanks sorry for my english |
|
#2
|
||||
|
||||
|
Convert it to something we can read first... you could do it by using the htmlentities function in PHP if you wanted...
http://us4.php.net/manual/en/function.htmlentities.php - Shawn
__________________
Free Keyword Ranking & Keyword Suggestion Tool Search Engine Forums where you are paid to be a user Western Union | eBay |
![]() |
| Viewing: SEO Chat Forums > Other > SEO Scripts > select |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|