Thread: select

    #1
  1. No Profile Picture
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Oct 2003
    Posts
    1
    Rep Power
    0

    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. #2
  3. Contributing User
    SEO Chat Good Citizen (1000 - 1499 posts)

    Join Date
    Aug 2003
    Location
    San Diego USA
    Posts
    1,274
    Rep Power
    17
    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

Similar Threads

  1. Googlebot hitting adword select
    By JRM in forum Google Optimization
    Replies: 0
    Last Post: Jul 15th, 2003, 12:27 PM
  2. Avatars not working for me
    By lowell in forum Suggestions & Feedback
    Replies: 2
    Last Post: May 2nd, 2003, 09:03 AM

IMN logo majestic logo threadwatch logo seochat tools logo