Hello ,
I have a problem ...
I have a file (users.txt) which contains user , password and number of user data similiar to this ;
file : users.txt
usera werwero 1
userb ysdkdfisd 2
userc sdfsdfdfd 3
userd ewrwerrr 4
usere rwerrrrrw 5
userf werreww 6
I created a file to create a webform which shows
all the users on file users.txt . The problem
is that is showing the user and the password and the usernumber while I need to extract only the users...
This is the code I am using...
$data_file = "/home/$usercp/users.txt";
if (!empty($HTTP_POST_VARS['is_sent'])) process_form();
print "<br><form action=\"killuser.php\" method=\"POST\" ";
$data = file($data_file);
$count = count($data);
$pos = 0;
for ($x = 0; $x < $count; $x++)
{
$data[$x] = trim($data[$x]);
if (!empty($data[$x]))
{
print "<input type=\"radio\" name=\"data\" value=\"$data[$x]\">\n";
print "<b>$data[$x]</b><br>";
}
}
print "<input type=\"submit\" value=\"SUBMIT" >\n";
print "</form>\n";
I wish to show only the user . The problem should be
here
$data[$x] = trim($data[$x])
it extracts the user and the password .
I am trying to extract only the user but I was not successfull ..
Any idea ?
Thank you