Re: [PHP] Assigning unique form names...

2002-04-09 Thread Jason Wong

On Wednesday 10 April 2002 03:20, Jas wrote:
> Here is what I need some information about, the script below opens a
> directory on the server, reads the files and places them into select
> boxes
> within a form, now I have this echoed multiple times on the page like
> so... Now I have tried to assign a form name
> based
> on the $file_name varibable but because the $file_name variable is
> created
> after the form has been created I cannot assign a unique form name each
> time
> I call .  If someone could point out another way
> to
> do this or point out a good function for this I would greatly appreciate
> it.
>  $dir_name = "/path/to/images/directory/";
> $dir = opendir($dir_name);
> $file_list .= "
> ";
>  while ($file_name = readdir($dir)) {
>   if (($file_name != ".") && ($file_name !="..")) {
>   $file_list .= " NAME=\"$file_name\">$file_name";
>   }
>  }
>  $file_list .= " VALUE=\"select\">";
>  closedir($dir);
> ?>

Will this do?

";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 closedir($dir);

$new_file_list .= $file_list . "

?>

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Too much of everything is just enough.
-- Bob Wier
*/

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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Anzak Wolf

I'm not sure if I can help you much here, but something I might suggest is 
going to a single page approach.  I have a class on www.phpclasses.org that 
you can download called Command Class.  Basicly the idea is that you have a 
single index.php file which loads your headers and footer information then 
based on a command and sub-command pair is does a database look up to find 
the file you wish to load as your content.  This way your form should always 
look like this.


form data


The only thing you would need to do is either as part of your form have a 
hidden field with the command and sub-command pair or you could have a 
script run after you create the $command object then set the command and 
subcommand based on the data you have then all you would need to do is when 
you are ready to display the page do a $command->load_command();  It works 
well for me though it is still early code and there might be some bugs and 
possible security issues I haven't worked out yet.

-Jim








_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Jas

right now I have it setup as a hardcoded file... here is the piece of code:
";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 closedir($dir);
?>
And this is what I am storing in the database...
Structure of table:
CREATE TABLE image_paths (
   id_index int(11) DEFAULT '0' NOT NULL,
   wel_area blob,
   ad01 blob NOT NULL,
   ad02 blob NOT NULL,
   ad03 blob NOT NULL,
   ad04 blob NOT NULL,
   ad05 blob NOT NULL,
   ad06 blob NOT NULL,
   ad01_t blob NOT NULL,
   ad02_t blob NOT NULL,
   ad03_t blob NOT NULL,
   ad04_t blob NOT NULL,
   ad05_t blob NOT NULL,
   ad06_t blob NOT NULL,
   PRIMARY KEY (id_index),
   KEY id_index (id_index)
);
Contents of table:
INSERT INTO image_paths VALUES ( '0', 'a
lot of text goes here for the main page',
'http://localhost/full_ad/willies_040402.jpg', 'blank', 'blank', 'blank',
'blank', 'blank', 'http://localhost/full_ad/willie_logo.jpg', 'blank',
'blank', 'blank', 'blank', 'blank');

Now I sincerely hope this helps because I am at a complete loss on how to
create either a unique field name or a unique action for the form in
question.  You see I have a page which displays the current contents of the
image_paths table, and what I need to do from there is have my form (top
piece of code) to be echoed to the screen in 12 places because there are 12
fields in my table that I need to give the user an option to select which
image they wish to be placed on the main page, ad01 = big image
ad01_t = thumbnail image
by creating a unique form name or unique action for my form I will be able
to either 1- pass the contents of users selection to another script that
enters the path and file name into the correct table field by use of the
form name or 2- pass the contents of the users selection to another script
(that again would put the image name and path into the appropriate field in
table) based on the unique action file name.  I know why it doesn't work and
that would be because upon the creation of the form the $file_name variable
reads the directory and places the results into the select boxes AFTER the
form is made.  Now being able to fix this is well beyond my scope.  I hope
this clears it up for everyone. =)
Thanks in advance,
Jas





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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Miguel Cruz

Where are you getting the target of ACTION= from? Is it just any one of 
the s? I don't understand what you're trying to do (and I don't 
think I'm alone here - you may even be among us).

Can you give a concrete example of what is in the database and how you 
would like the HTML to look?

miguel

On Mon, 8 Apr 2002, Jas wrote:

> Yeah I have tried $file_name but the problem stems from the while
> ($file_name = readdir($dir) being called after the creation of the form in
> $file_list.  Is there a way to put the ($file_name = readdir($dir) before
> the $file_list function?  I have tried to do it a couple of different ways
> such as making a new variable $files = ($file_name = readdir($dir)) {
>   if (($file_name != ".") && ($file_name !="..")) {
>   $file_list .= " NAME=\"$file_name\">$file_name";
>   }
>  }
> but that didn't work, I also tried another thing but so far nothing has
> allowed me to create a unique action in the form or a unique name for the
> form.
>  $dir_name = "/path/to/images/directory/";
> $dir = opendir($dir_name);
> $file_list .= " unique file name**\" NAME=\"$file_name\">";
>  while ($file_name = readdir($dir)) {
>   if (($file_name != ".") && ($file_name !="..")) {
>   $file_list .= " NAME=\"$file_name\">$file_name";
>   }
>  }
>  $file_list .= " VALUE=\"select\">";
>  closedir($dir);
> ?>
> 
> 
> 
> 


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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Jas

Yeah I have tried $file_name but the problem stems from the while
($file_name = readdir($dir) being called after the creation of the form in
$file_list.  Is there a way to put the ($file_name = readdir($dir) before
the $file_list function?  I have tried to do it a couple of different ways
such as making a new variable $files = ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
but that didn't work, I also tried another thing but so far nothing has
allowed me to create a unique action in the form or a unique name for the
form.
";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 closedir($dir);
?>



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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Paul Roberts

the html is wrong, option doesn't have an attribute of name, select has the name, 
option has the value.

try it like this, the result will be in $files


";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 closedir($dir);
 ?>

- Original Message - 
From: "Erik Price" <[EMAIL PROTECTED]>
To: "Jas" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, April 08, 2002 6:45 PM
Subject: Re: [PHP] Assigning unique form names...


> I understand what you're saying.  You like the convenience of having the 
> entire thing kept in a neat variable called $file_list, which you can 
> add to your page in any place that you like, but you need a unique name 
> for each  input tag so that on the "receiving" PHP script, you 
> can access the contents of each time that you use $file_list.
> 
> Unfortunately, I can't think of a good way for you to make these input 
> names unique.  The best thing I can suggest is that you turn this into a 
> function/subroutine, and pass the string you wish to use as a unique 
> name to the function as its argument (and you can make this a reuaseable 
> function by also passing the $dir_name as an argument, and the target of 
> the form tag).  Like this:
> 
> // $dir_name = name of directory to list
> // $form_target_page = name of page to receive this form's input
> // $input_name = unique name for this  input
> function file_list($dir_name, $form_target_page, $input_name)
> {
>if (!$dir = opendir($dir_name)) {
>  return "Could not open directory $dir_name";
>} else {
>  $file_start = "
> \n";
> 
>  while ($file_name = readdir($dir)) {
>if ($file_name != '.' && $file_name != '..') {
>  $file_list .= " value=\"$file_name\">$file_name\n";
>}
>  }
>  closedir($dir);
> 
>  $file_finish = "
>   value=\"select\">
>\n";
> 
>  // this function prints the form as its return value
>  return $file_start . $file_list . $file_finish;
>}
> }
> 
> 
> On Monday, April 8, 2002, at 12:58  PM, Jas wrote:
> 
> > Here is what I need some information about, the script below opens a
> > directory on the server, reads the files and places them into select 
> > boxes
> > within a form, now I have this echoed multiple times on the page like
> > so... Now I have tried to assign a form name 
> > based
> > on the $file_name varibable but because the $file_name variable is 
> > created
> > after the form has been created I cannot assign a unique form name each 
> > time
> > I call .  If someone could point out another 
> > way to
> > do this or point out a good function for this I would greatly 
> > appreciate it.
> >  > $dir_name = "/path/to/images/directory/";
> > $dir = opendir($dir_name);
> > $file_list .= "
> > ";
> >  while ($file_name = readdir($dir)) {
> >   if (($file_name != ".") && ($file_name !="..")) {
> >   $file_list .= " > NAME=\"$file_name\">$file_name";
> >   }
> >  }
> >  $file_list .= " > VALUE=\"select\">";
> >  closedir($dir);
> > ?>
> > Thanks in advance,
> > Jas
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
> 
> 
> -- 
> 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




RE: [PHP] Assigning unique form names...

2002-04-08 Thread Rick Emery

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:
";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 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;
}
?>


  
Front Page Contents
  
  
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.
  
  
Ad 01 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 01 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 02 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 02 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 03 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 03 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 04 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 04 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 05 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 05 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 06 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 06 Large Image
  
  

  

  

  
  Current Image

  

  

  

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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Jas

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:
";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 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;
}
?>


  
Front Page Contents
  
  
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.
  
  
Ad 01 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 01 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 02 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 02 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 03 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 03 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 04 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 04 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 05 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 05 Large Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 06 Small Image
  
  

  

  

  
  Current Image

  

  

  
  
Ad 06 Large Image
  
  

  

  

  
  Current Image

  

  

  

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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Kevin Stone

I thought I'd already answered this question but maybe you missed it.  No
you cannot create an array based on 12 forms.  But you CAN create an array
based on 12 form inputs.  For example..



image1.jpg
image2.jpg



image1.jpg
image2.jpg



One form with two identical inputs.  The Square brackets will return the
values in an indexed array called $files.  If register globals is not turned
on you can extract the array from $_POST just as you normaly would.
Hopefully that clears things up.
-Kevin

- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 08, 2002 12:34 PM
Subject: Re: [PHP] Assigning unique form names...


> How about this...
> Would I be able to create an array based on the 12 different  ACTION="filenames.php" pieces that I need? and then simply call a
different
> array result for each filenames.php?  If so how could i do this, sorry to
be
> such a pain but I am trying everything I know and this seems like it
should
> work, but then again what do i know.
> 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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Jas

Sorry about that...
What I think "might" work and I still working on the code for is to create
an array to place the 12 different files I am attempting to use (seems a bit
unnecessary but I am still new to php and this assists me in keeping it
organized) and then call one field of the array to each separate form
action the reason I would like to do it this way is because if I were to
have a unique form action I would be able to pass the users selection to one
of the 12 different files therefore creating unique forms for each of the 12
fields I need to update in the db.
";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 closedir($dir);
?>
If you can tell I am not very good at array's either, but I think this
illustrates what I am trying to accomplish which would be to place all the
files I need into an array named $file_array and then where I begin to
create my form I figure I could pull the array contents then count up 1 for
each form I make, not sure if this will work and if it doesn't please tell
me why as I am still trying to learn php. Thanks again,
Jas



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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Erik Price


On Monday, April 8, 2002, at 02:34  PM, Jas wrote:

> How about this...
> Would I be able to create an array based on the 12 different  ACTION="filenames.php" pieces that I need? and then simply call a 
> different
> array result for each filenames.php?  If so how could i do this, sorry 
> to be
> such a pain but I am trying everything I know and this seems like it 
> should
> work, but then again what do i know.

A couple of things:

(1) This mailing list is kind of like HTTP -- stateless.  Just as a PHP 
script can't "remember" data unless you continually pass it again and 
again, many of us see to great a volume of mail to "remember" what a 
thread is talking about.  Be sure to quote relevant parts of a previous 
email so that we know what you refer to, it's too much trouble otherwise 
for us to check the archives to do this.  (Quoting more than the needed 
info is likewise unhelpful.)

(2) Fortunately, I remember coming up with what I had assumed was a 
solution to your problem just a few minutes ago.  Did the use of a 
function not work for you, or is there some reason that you need to use 
an alternative technique?  If this is the case, then please let me know, 
I'll try to come up with another solution.  As for the use of an array 
to do it, I don't see why not -- but try to be a bit more illustrative 
of what you want, since there are an infinite number of ways to use an 
array in this case.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Jas

How about this...
Would I be able to create an array based on the 12 different http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Erik Price

I understand what you're saying.  You like the convenience of having the 
entire thing kept in a neat variable called $file_list, which you can 
add to your page in any place that you like, but you need a unique name 
for each  input tag so that on the "receiving" PHP script, you 
can access the contents of each time that you use $file_list.

Unfortunately, I can't think of a good way for you to make these input 
names unique.  The best thing I can suggest is that you turn this into a 
function/subroutine, and pass the string you wish to use as a unique 
name to the function as its argument (and you can make this a reuaseable 
function by also passing the $dir_name as an argument, and the target of 
the form tag).  Like this:

// $dir_name = name of directory to list
// $form_target_page = name of page to receive this form's input
// $input_name = unique name for this  input
function file_list($dir_name, $form_target_page, $input_name)
{
   if (!$dir = opendir($dir_name)) {
 return "Could not open directory $dir_name";
   } else {
 $file_start = "
\n";

 while ($file_name = readdir($dir)) {
   if ($file_name != '.' && $file_name != '..') {
 $file_list .= "$file_name\n";
   }
 }
 closedir($dir);

 $file_finish = "
 
   \n";

 // this function prints the form as its return value
 return $file_start . $file_list . $file_finish;
   }
}


On Monday, April 8, 2002, at 12:58  PM, Jas wrote:

> Here is what I need some information about, the script below opens a
> directory on the server, reads the files and places them into select 
> boxes
> within a form, now I have this echoed multiple times on the page like
> so... Now I have tried to assign a form name 
> based
> on the $file_name varibable but because the $file_name variable is 
> created
> after the form has been created I cannot assign a unique form name each 
> time
> I call .  If someone could point out another 
> way to
> do this or point out a good function for this I would greatly 
> appreciate it.
>  $dir_name = "/path/to/images/directory/";
> $dir = opendir($dir_name);
> $file_list .= "
> ";
>  while ($file_name = readdir($dir)) {
>   if (($file_name != ".") && ($file_name !="..")) {
>   $file_list .= " NAME=\"$file_name\">$file_name";
>   }
>  }
>  $file_list .= " VALUE=\"select\">";
>  closedir($dir);
> ?>
> Thanks in advance,
> Jas
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Assigning unique form names...

2002-04-08 Thread Kevin Stone

Try   The square brackets will allow you to
capture selections from multiple lists in an indexed array, $files.
Hope that does what you need.
-Kevin

The square brackets will allow you to capture the variable $file_name

-Original Message-
From: Jas [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 08, 2002 10:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Assigning unique form names...

Here is what I need some information about, the script below opens a
directory on the server, reads the files and places them into select
boxes
within a form, now I have this echoed multiple times on the page like
so... Now I have tried to assign a form name
based
on the $file_name varibable but because the $file_name variable is
created
after the form has been created I cannot assign a unique form name each
time
I call .  If someone could point out another way
to
do this or point out a good function for this I would greatly appreciate
it.

";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 closedir($dir);
?>
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




[PHP] Assigning unique form names...

2002-04-08 Thread Jas

Here is what I need some information about, the script below opens a
directory on the server, reads the files and places them into select boxes
within a form, now I have this echoed multiple times on the page like
so... Now I have tried to assign a form name based
on the $file_name varibable but because the $file_name variable is created
after the form has been created I cannot assign a unique form name each time
I call .  If someone could point out another way to
do this or point out a good function for this I would greatly appreciate it.

";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 closedir($dir);
?>
Thanks in advance,
Jas



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