Posts

PHP program

Image
  Userauthentication.php <?php $con= mysqli_connect("localhost", "root", "weareteam@2020") or die('could not connect to server'); mysqli_select_db("drgjena", $con) or die('could not connect to database'); $user = $_POST['Uname']; $pssword = $_POST['password']; //$query = "SELECT userid from user where userid = '$username' and password = PASSWORD('$password')"; $query = "SELECT * from users"; $result = mysqli_query($query); while($value=mysqli_fetch_array($result)) { if($user == $value['userid'] && $pssword == $value['password']) { echo "login success"; echo "username:".$value['useriname']; echo "password:".$value['password']."<br>"; break; } else {           echo "not authenticated";         break;  ...

Web development Lab

  3)   Create Web pages using AJAX.   SOURCE CODE :- <?php // Array with names $a[] = "Anna"; $a[] = "Brittany"; $a[] = "Cinderella"; $a[] = "Diana"; $a[] = "Eva"; $a[] = "Fiona"; $a[] = "Gunda"; $a[] = "Hege"; $a[] = "Inga"; $a[] = "Johanna"; $a[] = "Kitty"; $a[] = "Linda"; $a[] = "Nina"; $a[] = "Ophelia"; $a[] = "Petunia"; $a[] = "Amanda"; $a[] = "Raquel"; $a[] = "Cindy"; $a[] = "Doris"; $a[] = "Eve"; $a[] = "Evita"; $a[] = "Sunniva"; $a[] = "Tove"; $a[] = "Unni"; $a[] = "Violet"; $a[] = "Liza"; $a[] = "Elizabeth"; $a[] = "Ellen"; $a[] = "Wenche"; $a[] = "Vicky...

Game Development Lab

 Exp 5. Write a c# script to Destroy game objects Over Time (Object pooling).  Aim: Write a script to destroy a GameObject within a specific Time.  using System.Collections;  using System.Collections.Generic;  using UnityEngine;  public class DestroyOverTime : MonoBehaviour  {  public float lifeTime;  // Start is called before the first frame update  void Start()  {  }  // Update is called once per frame  void Update()  {  /* lifeTime -= Time.deltaTime;  if(lifeTime< 0)  {  Destroy(gameObject);  } */  Destroy(gameObject, lifeTime);  }  }   Exp4 . Write a C# script for damaging and killing the player depending on his health.  using System.Collections;  using System.Collections.Generic;  using UnityEngine;  public class KillPlayer : MonoBehaviour  {  private void OnTriggerEnter2D(Collider2D other)  {  if(other.tag == "Player") ...

first and follow

 Ex-6  Write a C program to compute the First and Follow sets for the given Grammar  /* A=aAbA  B=bBaB  A=a  B=b   */      #include<stdio.h>  #include<math.h>  #include<string.h>  #include<ctype.h>  #include<stdlib.h>  int n,m=0,p,i=0,j=0;  char a[10][10],f[10];  void follow(char c);  void first(char c);  int main(){  int i,z;  char c,ch;  printf("Enter the no of prooductions:\n");  scanf("%d",&n);  printf("Enter the productions:\n");  for(i=0;i<n;i++)  scanf("%s%c",a[i],&ch);  do{  m=0;  printf("Enter the elemets whose fisrt & follow is to be found:");  scanf("%c",&c);  first(c);  printf("First(%c)={",c);  for(i=0;i<m;i++)  printf("%c",f[i]);  printf("}\n");  strcpy(f," ");  //flushall();  m=0;  follow(c);  printf("Follow(%c)={",c);...

4. Write a C program to implement the Brute force technique of Top down Parsing.

 #include<stdio.h>   #include<stdlib.h>   #include<string.h>   int A();   char str[15];   int isave,curr_ptr=0;   int main(void)   {   printf("1.S->cAd\n2.A->ab/a\n");   printf("this is parser for the above grammar:\n");   printf("Enter any string:");   scanf("%s",&str);   while(curr_ptr<strlen(str))   {   {   if (str[curr_ptr]=='c')   curr_ptr++;   if (A())  {   curr_ptr++;   if (str[curr_ptr]=='d' && str[curr_ptr+1]=='\0')   {   printf("string is accepted by the grammar");      return 1;   }   else break;   }   else break;   }   //else break;   }   printf("string is not accepted by the grammar");   return 0;   }...

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...