CC - Lab FINAL
CC - Lab FINAL
AIM:
To create key based authentication and login virtual machines from the host machines
and installing required software by connecting with SSH or PUTTY.
ALGORITHM:
1. Start Putty
2. Fill n the hostname or IP address of our VM from the Azure portal
3. Select the Connection > SSH > Auth category. Browse to and select your Putty
private
Key (.ppk file)
RESULT:
Thus the key based authentication and login virtual machine from the host machines and
installation required software by connecting with SSH or Puny is executed successfully.
AIM:
To install a web server in the virtual machine and create a sample web application using
HTML,JS,host and running it in the browser.
ALGORITHM:
1. Power on the virtual machine and note the virtual machine’s IP address.Ensure that the
IP address is set to Static.
2. Power off the virtual machine.
3. In the Vmware Workstation toolbar,click Edit > Virtual Network Editor.
4. Select the vmnet NAT adapter which you have configured on the particular virtual
machine.
5. Select the NAT Settings option. The NAT settings dialog appears.
8. Click OK.
9. Power on the virtual machine and configure the Web server as required. Ensure to use
the same port number that you configured in Step 7 for the Web server on the virtual
machine.
RESULT:
Thus the web server in the virtual machine is installed and a sample web
application using HTML,JS,host is created successfully.
AIM:
To create simple logic and communication with front end app using AJAX
ALGORITHM:
Step 1 : Prepare a picture for writing an AJAX program.Save the picture in the same folder
where you will save your html and text files displaying the Ajax program.
Step 2 : "ProgramInAjax" directory is set up inside the "wamp" folder under the "www"
directory where you installed WampServer.
Step 3: Open any text editor. Notepad++ is used as the text editor in this article.
Step 4: Create a new file in the text editor. Type the following,You may type whatever you want
inside the html tag <h2></h2> here.
Step 5: Save the file as a text document with the name of "ajax-data.txt."
Step б: Actually, you can name the file whatever you want but make sure you enter the same
file name to the coding in this line:
Step 7: Create a new file for a webpage. This file is for an HTML file to view the Ajax program
in a Web browser.
Step 8: Save the file. Click the save button on the menu bar. A "Save As" box is open. Enter a
name for your document. In this article, the name of the file is "index."
Step 9: At the "Save as type" field, click the drop down arrow to choose the file extension
PROGRAM:
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
date_default_timezone_set('Asia/Kolkata'); // change according
timezone
if(isset($_POST['submit']))
{
while($row=mysql_fetch_array($sql))
{
$cmpn=$row['complaintNumber'];
}
$complainno=$cmpn;
echo '<script> alert("Your complain has been successfully filled
and your complaintno is "+".$complainno."")</script>';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Dashboard">
<meta name="keyword" content="Dashboard, Bootstrap, Admin,
Template, Theme, Responsive, Fluid, Retina">
<title>CMS | User Register Complaint</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<!--external css-->
RESULT:
Thus the program was to create simple backend logic and communication with the front end app using
AJAX executed successfully.
AIM:
To create sql db and design schema for user session details. retrieve the details of the
front end application.
ALGORITHM:
Step 1: Type a code in notepad++.
Step 2: Save the code with .php extension.
Step 3: Create a form name order management system.
Step 4: Create a database as ordered.
Step 5: Retrieve all the attributes by using the GET and POST method.
Index.php
<!DOCTYPE HTML>
<html>
<head>
</head>
<body background="feed.jpg”>
<center><h I >Order Management System</h1 ></center>
<center><table>
<form method="post" action="pro.php">
<th>
Buyer Name: <input type="text" name="name" >
<br><br>
<br><br>
<br><br><center>
<br><br>
<br><br>
Delivery Address: <textarea type="text" name=”deleaddr" rows=”5”
cols="20”></textarea>
<br><br>
<br><br>
</form>
</th>
</table></center>
</body>
</html>
Pro.php
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<?php
$buyeraddr=$productname= "";
if($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["name"])) {
} else {
$name = test_input($_POST["name”]);
if (!preg_match("/^[a-zA-Z ]*$/",$name)) (
if (empty($_POST["email”])) {
} else {
$email = test_input($_POST["email"]);
if (empty($_POST["buyeraddr”])) {
} else {
$buyeraddr = test_input($_POST["buyeraddr"]);
if (!filter_var($buyeraddr, FILTER_VALIDATE_EMAIL)) {
if (empty($_POST["productname"])) {
$productname = "";
} else {
$productname = test_input($_POST["productname"]);
if (empty($_POST["gender"])) {
} else {
$gender = test_input($_POST["gender"]);
if (empty($_POST["contact"])) {
} else {
$contact = test_input($_POST["contact"]);
if (empty($_POST["deleaddr"])) {
} else {
$deleaddr = test_input($_POST[”deleaddr"]);
if (!filter_var($deleaddr, FILTER_VALIDATE_EMAIL)) {
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
<?php
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
OUTPUT :
AIM:
To Create a user name, store the password in the SQL. Login using user name/password and
validate.
ALGORITHM:
Step 1: Type a code in Notepad++
Step 2: Save the code with .php extension.
Step 3: Create a form name as Login.
Step 4: Create Database as 'user_registration'
PROGRAM:
login.php
<!doctype html>
<html>
<head>
<title>Login</title>
<style>
body{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
background-color: azure ;
color: palevioletred;
font-family: verdana;
font-size: 100%
}
register.php
<!doctype html>
<html>
<head>
<title>Register</title>
<style>
logout.php
<? php
session_start();
unset($_SESSION[„sess_user‟]);
session_destroy();
header(“location:login.php”)
?>
member.php
<?php
session_start();
if(!isset($_SESSION["sess_user"])){
header("location:login.php");
} else {
?>
<!doctype html>
<html>
<head>
<title>Welcome</title>
<style>
body{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
MYSQL</h1></center>
OUTPUT
AIM:
To Install and Configure Google App Engine.
PROCEDURE:
1. Create a Google Cloud Platform project, if you don't have one already.
2. Make sure that Python 2.7 is installed on your system:
python -V
Note: As of Cloud SDK version 206.0.0, the gcloud CLI has experimental support for running using a
Python 3.4+ interpreter (run gcloud topic startup for exclusions and more information on configuring your
Python interpreter). All other Cloud SDK tools still require a Python 2.7 interpreter.
3. Download the archive file best suited to your operating system. Most machines will run the 64-bit package.
If you'd like to check, run uname -m to verify if you're running a 64-bit system.
4. Extract the archive to any location on your file system; preferably, your Home folder. On Linux, you can
extract the archive file by running this command:
tar zxvf [ARCHIVE_FILE] google-cloud-sdk
5. If you're having trouble getting the gcloud command to work, ensure your $PATH is defined appropriately.
Use the install script to add Cloud SDK tools to your path. You will also be able to opt-in to
command-completion for your bash shell and usage statistics collection during the installation process. Run
the script using this command:
./google-cloud-sdk/install.sh
AIM:
Design an Assignment to retrieve, verify, and store user credentials using Firebase Authentication, the
Google App Engine standard environment, and Google Cloud Data store.
PROCEDURE:
Before you begin
Step-I: Install Git,
sudo apt install git-all
Step-II: Install Python 2.7
Step-III: Sign in to your Google Account.
If you don't already have one, sign up for a new account.
Step-IV: Select or create a GCP project.
Note: If you don't plan to keep the resources you create in this tutorial, create a new project instead of
selecting an existing project. After you finish, you can delete the project, removing all resources associated
with the project and tutorial.
GO TO THE MANAGE RESOURCES PAGE
Step-V: Install and initialize the Cloud SDK.
If you have already installed and initialized the SDK to a different project, set the gcloud project
to the App Engine project ID you're using for Firenotes. See Managing Cloud SDK Configurations for
specific commands to update a project with the gcloud tool.
Step-VI: Cloning the sample app
To download the sample to your local machine:
Clone the sample application repository to your local machine:
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
Alternatively, you can download the sample as a zip file and extract it.
Navigate to the directory that contains the sample code:
cd python-docs-samples/appengine/standard/firebase/firenotes
3. In the frontend/main.js file, configure the FirebaseUI login widget by selecting which providers you want
to offer your users.
appengine/standard/firebase/firenotes/frontend/main.js
VIEW ON GITHUB
// Firebase log-in widget
function configureFirebaseLoginWidget() {
var uiConfig = {
'signInSuccessUrl': '/',
'signInOptions': [
// Leave the lines as is for the providers you want to offer your
users.
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
firebase.auth.TwitterAuthProvider.PROVIDER_ID,
firebase.auth.GithubAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID
],
// Terms of service url
'tosUrl': '<your-tos-url>',
};
var ui = new firebaseui.auth.AuthUI(firebase.auth());
ui.start('#firebaseui-auth-container', uiConfig);
}
4. Enable the providers you have chosen to keep in the Firebase console by clicking Authentication > Sign-in
method. Then, under Sign-in providers, hover the cursor over a provider and click the pencil icon.
RESULT:
Thus the program to Design an Assignment to retrieve, verify, and store user credentials using Firebase
Authentication, the Google App Engine standard environment, and Google Cloud Data store is implemented
successfully.