perhaps you could use $file_name

-----Original Message-----
From: Jas [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 08, 2002 2:54 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Assigning unique form names...


Ok I understand what you mean here, however what I need to do is have a
unique form action for each separate form being displayed on the page which
totals 12... here is the code for the page:
<?php
$dir_name = "/path/to/images/directory/";
$dir = opendir($dir_name);
$file_list .= "<p><FORM METHOD=\"post\" ACTION=\"**I need this to be a
unique file name**\" NAME=\"$file_name\"><SELECT NAME=\"files\">";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "<OPTION VALUE=\"$file_name\"
NAME=\"$file_name\">$file_name</OPTION>";
  }
 }
 $file_list .= "</SELECT><br><br><INPUT TYPE=\"submit\" NAME=\"submit\"
VALUE=\"select\"></FORM></p>";
 closedir($dir);
$table = "table_name";
$dbh = mysql_connect('localhost','user_name','password') or die('Could not
connect to database, please try again later');
mysql_select_db('db_name') or die('Could not select database, please try
again later');
$record = @mysql_query("SELECT wel_area, ad01_t, ad01, ad02_t, ad02, ad03_t,
ad03, ad04_t, ad04, ad05_t, ad05, ad06_t, ad06 FROM $table",$dbh);
while ($row = mysql_fetch_array($record)) {
 list($wel_area, $ad01_t, $ad01, $ad02_t, $ad02, $ad03_t, $ad03, $ad04_t,
$ad04, $ad05_t, $ad05, $ad06_t, $ad06) = $row;
}
?>
<body >
<table width="100%" border="1" cellspacing="0" cellpadding="5"
bordercolor="#ffffff">
  <tr>
    <td><b>Front Page Contents</b></td>
  </tr>
  <tr>
    <td>This section is the front page of Big Nickel.net, use
      the scroll bar to scroll down to the section you would like to edit,
if
      you need help using html tags please refer to the help section and
tutorial.</td>
  </tr>
  <tr>
    <td><b><i>Ad 01 Small Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad01_t; ?>" width="200" height="100"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 01 Large Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad01; ?>" width="200" height="300"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 02 Small Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad02_t; ?>" width="200" height="100"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 02 Large Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad02; ?>" width="200" height="300"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 03 Small Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad03_t; ?>" width="200" height="100"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 03 Large Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad03; ?>" width="200" height="300"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 04 Small Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad04_t; ?>" width="200" height="100"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 04 Large Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad04; ?>" width="200" height="300"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 05 Small Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad05_t; ?>" width="200" height="100"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 05 Large Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad05; ?>" width="200" height="300"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 06 Small Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad06_t; ?>" width="200" height="100"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td><b><i>Ad 06 Large Image</i></b></td>
  </tr>
  <tr>
    <td>
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <? echo "$file_list"; ?>
          </td>
          <td>Current Image<br>
            <img src="<?php echo $ad06; ?>" width="200" height="300"
vspace="0" hspace="0" border="0">
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
Now for each form there is a resulting db query as well to show the current
contents of that db field.  With the 12 forms I need 12 unique actions so
that each form becomes a separate form which links to a separate script to
place the results of an individual select box into the correct db field.
The method you showed me works for updating multiple fields at once however
I need to be able to make each select box within its own unique form.  I
hope this clears things up as to what I am trying to accomplish.  Any help
or pointers would be a great help at this point.
Thanks in advance,
Jas



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to