Posts

Showing posts from March, 2024

8) User Authentication: Assume four users user1, user2, user3 and user4 having the passwords pwd1, pwd2, pwd3 and pwd4 respectively. Write a PHP for doing the following. 1. Create a Cookie and add these four user id’s and passwords to this Cookie. 2. Read the user id and passwords entered in the Login form and authenticate with the values (user id and passwords) available in the cookies. If he is a valid user (i.e., user-name and password match) you should welcome him by name (user-name) else you should display ―You are not an authenticated user ’’. Use init-parameters to do this

Image
EXPERIMENT 8 Aim: User Authentication Assume four users user1, user2, user3 and user4 having the passwords pwd1, pwd2, pwd3 and pwd4 respectively. Write a PHP for doing the following. 1.   Create a Cookie and add these four user ID’s and passwords to this Cookie. 2.   Read the user id and passwords entered in the Login form (week1) and authenticate with the values (user id and passwords) available in the cookies. If he is a valid user (i.e., user-name and password match) you should welcome him by name (user-name) else you should display “You are not an authenticated user ’’.   SOURCE CODE :-   coklogcheck.html <html> <title>website</title> <head></head> <body> <form method="POST" name="frmlogin" action="coklogcheck.php"> <table border="0"> <tr> <td>Login:</td...

Creating the static Web page

  Login.html <html> <head> <title> Login </title> </head> <body bgcolor="pink"> <center> <form> &nbsp;&nbsp;&nbsp;&nbsp; <b>Login: <input type="text" name="login"/> <br><br> Password: <input type="password" name="password"/> <br><br> <input type="submit" value="Submit"/> <input type="reset" value="Reset"/> </b> </form> </center> </body> </html. Register.html     <html> <head> </head> <title> New User! </title> <body> <form> <center> <h1> <font size="3"> Registration Form </font> </h1> <hr witdh="50%"> <pre> User Name: <input type="text" maxlength=15 size=25/> Password: <inp...

7. Write a C program for eliminating the left recursion and left factoring of a given grammar

Left Factoring:  #include<stdio.h>  #include<string.h>  int main()  {      char gram[20],part1[20],part2[20],modifiedGram[20],newGram[20],tempGram[20];      int i,j=0,k=0,l=0,pos;      printf("Enter Production : A->");      gets(gram);      for(i=0;gram[i]!='|';i++,j++)          part1[j]=gram[i];      part1[j]='\0';      for(j=++i,i=0;gram[j]!='\0';j++,i++)          part2[i]=gram[j];      part2[i]='\0';      for(i=0;i<strlen(part1)||i<strlen(part2);i++){          if(part1[i]==part2[i]){              modifiedGram[k]=part1[i];              k++;              pos=i+1;                }    ...