moirakris
Technical User
- Oct 11, 2002
- 82
Ok this is my first time working/modifying php code so I am a total newbie. I am trying to display the username, email, location and join date for all users stored in the users.php
It does this but it lists the first entry (admin) twice and I cannot for the life of me figure out why it's doing this.
Also is there a way to make the displayed email user address a mailto link?
Here is the code I have there now. If you need to see a live copy of it just let me know.
Thanks for any help you can give.
Warmest Regards,
Moira
It does this but it lists the first entry (admin) twice and I cannot for the life of me figure out why it's doing this.
Also is there a way to make the displayed email user address a mailto link?
Here is the code I have there now. If you need to see a live copy of it just let me know.
Thanks for any help you can give.
Warmest Regards,
Moira
Code:
<?php
// Get all users from file
$file = file("users.php");
// Get amount of lines in file
$totalLines = sizeof($file);
// Loop through and display all users
for($line = 0; $line < $totalLines; $line++){
// Dont print out lines beginning with a comment
if("//" != substr($file[$line], 0, 2)){
// Put contents of line into variables
@list($username, $password, $perm, $email, $url, $dob, $location, $joined) = explode("<del>", $file[$line]);
$string .= "<span style = 'color: #191970;'>Name:</span> ". $username."<br>";
//$string .= "password (md5()): ". $password. "<br>";
//$string .= "permission: ". $perm. "<br>";
$string .= "<span style = 'color: #191970;'>Email:</span> ". $email. "<br>";
//$string .= "url: ". $url. "<br>";
//$string .= "date of birth: ". $dob. "<br>";
$string .= "<span style = 'color: #191970;'>Location:</span> ". $location. "<br>";
$string .= "<span style = 'color: #191970;'>Joined:</span> ". $joined. "<br><hr>";
echo $string;
}
}
?>