Using array elements in a form
Posted: Thu Aug 19, 2004 9:09 am
Hi,
I am trying to create a form which a sysadmin can use to change users passwords.
I have used BASH scripting to create a file with a list of all valid, non system users called /tmp/finluserlist.
So next I create an array containing all the users as ellements and count the number of elements in the array like this:
Now here is where I get stuck. I need the ellements of the array to be presented in a dropdown box in an html form, but How do I get the correct number of options to the form? And can I call the ellemants directly from the html like this?
This is all very new to me so please don't flame.
Thanks
I am trying to create a form which a sysadmin can use to change users passwords.
I have used BASH scripting to create a file with a list of all valid, non system users called /tmp/finluserlist.
So next I create an array containing all the users as ellements and count the number of elements in the array like this:
Code: Select all
<?php
include('header.php');
$users= file("/tmp/finlusrlist");
$number_of_users = count($users)Code: Select all
?>
<form action="chnagepasswd.php" method=post>
<br>
<br>
<br>
<table border=0>
<tr bgcolor="orange">
<td width=250>Select Username</td>
<td width=150>Enter new password</td>
<td width=150>Confirm new password</td>
</tr>
<tr>
<td width=250><select name="user">
<td width=250><option vallue="$usersї0]">
<td>This is all very new to me so please don't flame.
Thanks