Code:
void password(void){
char name2[210], pass[210];
int n=0, p=0;
textcolor(YELLOW);
highvideo();
clrscr();clrscr();
for(;;){
textcolor(YELLOW);
clrscr();
printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");printf("*IMPORTANT NOTE* : <backspace> is not allowed. If you press <backspace>, while\n");
printf("typing the User Name or Password, they will be considerd incorrect.\n");
cprintf("\n");
cprintf("\n");
cprintf("");
cprintf(" ENTER LOGIN NAME >> ");
cprintf("\n\n");
cprintf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
cprintf("ENTER PASSWORD >> ");delay();delay();
gotoxy(23,8);
cscanf("%s", name2);
if((!strcmp(name2, "q"))==1){gotoxy(1,8); cprintf("%c", 258); n=1;}
else {gotoxy(1,8); cprintf("X");}
gotoxy(21,10);
getch();
for(int i=0;;i++){
pass[i]=getch();
if(pass[i]=='\r'){break;}
if(pass[i]=='\b'){printf("\b"); i=i-2; continue;}
cprintf("%c", 177);
}
if((pass[0]=='w') && (pass[1]=='o') && (pass[2]=='r') && (pass[3]=='d'))
{gotoxy(1,10); cprintf("%c", 258); p=1;}
else {gotoxy(1,10); cprintf("X");}
gotoxy(1,12);
textcolor(RED);
if((p==0) || (n==0)){cprintf("\a\a -The correct login name and password must be provided to enter the database. -If you have pressed [backspace], please try to avoid pressing it next time."); pause(); clrscr();}
else {break;}
}
}