hi, i'm newly migrating to asp.net from php.. i want to convert this PHP code in ASP.net.. i will appreciate the efforts:)
<?
$username = $_POST['username']; // get the username
$username = trim(htmlentities($username)); // strip some crap out of it
$file = '/home/js4hire/public_html/gafyd/data.csv'; // Here's the file. Notice the full path.
echo check_username($file,$username); // call the check_username function and echo the results.
function check_username($file_in,$username){
$username=strtolower($username);
$file = file($file_in);
foreach ($file as $line_num => $line) {
$line = explode(',',$line);
$user = trim(str_replace('"','',$line[0]));
if($username == strtolower($user)){
return '<span style="color:#f00">Username Unavailable</span>';
}
}
return '<span style="color:#0c0">Username Available</span>';
}
?>
thank U