need help pls..

Discussion in 'PHP' started by cris02, Mar 9, 2006.

  1. #1
    just want to ask a simple question how can i put this code:

    
    <select name="name" id="name" style="width:32%;"> 
    <option value="" seleted="selected">Select client name</option> 
    <?php 
    $sql = mysql_query("SELECT * FROM client ORDER BY Client_name"); 
    while ($row = mysql_fetch_assoc($sql)) 
    { 
        echo '<option value='.$row['value'].'>'.$row['Client_name']; 
    } 
    ?> 
    </select>
    
    Code (markup):
    inside of this echo:
    
    echo "<CENTER><table width='32%' border='1' align='center' bordercolor='#000000'><tr><td height='93'><div align='left'><FORM name='cris' ACTION='$PHP_SELF' METHOD=post enctype=\"multipart/form-data\"><p><INPUT TYPE='file' name='filename'><BR><font color='#000000' size='2' face='Tahoma'><strong>Type the client name</strong></font><br><input type=\"hidden\" name=\&quot;action\&quot; value=\"uploadProg\"><INPUT TYPE='hidden' name='action' value='upload'><br><INPUT name='submit' TYPE='submit' value='Upload File'></p></FORM></div></td></tr></table>";
    
    Code (markup):
    just i downloaded this code i want to modify thanks in advance..
     
    cris02, Mar 9, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this:
    
    <?php
    echo"first part of your form";
    ?>
    <select name="name" id="name" style="width:32%;"> 
    <option value="" seleted="selected">Select client name</option> 
    <?php 
    $sql = mysql_query("SELECT * FROM client ORDER BY Client_name"); 
    while ($row = mysql_fetch_assoc($sql)) 
    { 
        echo '<option value='.$row['value'].'>'.$row['Client_name']; 
    } 
     ?>
    </select>
    <?php
    echo"second part of your form";
    ?>
    
    Code (markup):
     
    mad4, Mar 9, 2006 IP
  3. cris02

    cris02 Member

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    thanks for the reply.. one more questions...

    well, i'm just trying to copy the selected item on my select box going to my input box even if the select box not in focus? is that posible anyway.. anyone have an idea? plss help.
    using this code:
    
    <center><select name="names" id="names" style="width:32%;"><option selected="selected">Select client name</option>
    <?php 
    $sql = mysql_query("SELECT * FROM client ORDER BY Client_name"); 
    while ($row = mysql_fetch_assoc($sql)) 
    { 
        echo '<option value='.$row['value'].'>'.$row['Client_name']; 
    } 
    ?> 
    </select>  
    </center>
    <?
    $destination=$name."/documents";
    echo "<CENTER><table width='32%' border='1' align='center' bordercolor='#000000'><tr><td height='93'><div align='left'><FORM name='cris' ACTION='$PHP_SELF' METHOD=post enctype=\"multipart/form-data\"><p><INPUT TYPE='file' name='filename'><BR><input type='text' name='name'><font color='#000000' size='2' face='Tahoma'><strong>Type the client name</strong></font><br><input type=\"hidden\" name=\&quot;action\&quot; value=\"uploadProg\"><INPUT TYPE='hidden' name='action' value='upload'><br><INPUT name='submit' TYPE='submit' value='Upload File'></p></FORM></div></td></tr></table>";
    
    PHP:
    i would like to copy the value of select box "names" going to input box "name"
     
    cris02, Mar 9, 2006 IP