What are cookies in JavaScript?

Cookies

A cookie is a small piece of text data set by the Web server that resided on the client’s machine. Once it’s been set, the client automatically returns the cookie to the webserver with each request that it makes. This allows the server to place values it wishes to ‘remember’ in the cookie, and have access to them when creating a response.

How Cookie Works

How Cookie Works

How Cookie Works

How Dangerous Cookies are

Type of Cookies

  • Session Cookies – Cookies that are set without the expires field are called session cookies. It is destroyed when the user quits the browser.
  • Persistent Cookies – The browser keeps it up until their expiration date is reached.
Tagged : / / /

What is JaveScript?

JavaScript is the programming language of HTML and the Web. It makes the web pages dynamic. It is an interpreted programming language with object-oriented capabilities. JavaScript is also known as client-side language. This is the client site language itself. But some people also call it server site language.

The meaning of the client site which is accessed by the user is called client site language. And what runs in the server is called the server-side language.

JaveScript History

  • JavaScript was introduced in 1995 by Netscape. And it was developed by Brendan Eich.
  • It was first named Mocha.
  • After that its name was changed to Livescript.
  • Then javascript.
  • Then it came to be called Ekamscript. But still people call it JavaScript only.
  • There is a 5,6 version of Ekscript. May have come in 2009.

Tools

  • Notepad
  • Notepad++
  • Any Text Editor

JavaScrips and Java Same?

No, Only java has similarities in JavaScript and java, apart from this there are no similarities in it.

Java programming language was very popular when Javascripts was being launched in the market, so they merged java with them, and then it was named JavaScript.

Advantage of JavaScript

  • Client Side execution
  • Velidation on Browser
  • easy language

Disadvantage of JavaScript

  • Less Secure
  • No Hardware Access

Why of adding JavaScript

Here too, if you want to use JavaScript, then you have to link both the files through your HTML. And it has its own different rules.

  • Inline

-Inside head tag
-inside body tag

  • External file

-Inside head Tag

-Inside body Tag

Inline

You can write inline in 2 ways, inline and external.

Inside head Tag –

<html>
	<head><title>Hello JS</title>
		<script type="text/javascript">
			document.write("Hello DevOpSchool");
		</script>
	</head>
	</body>
`		<h1>I am heading</h1>
		<p>I am Paraghraph</p>
	</body>
	
</html>

Inside body tag

<html>
	<head><title>Hello JS</title>
		
	</head>
	</body>
`		<h1>I am heading</h1>
		<p>I am Paraghraph</p>
		<script type="text/javascript">
			document.write("Hello DevOpSchool");
		</script>
	</body>
	
</html>

External

Inside head tag

<html>
	<head><title>Hello JS</title>
		<script src="name.js" type="text/javascript">
		</script>
	</head>
	</body>
`		<h1>I am heading</h1>
		<p>I am Paraghraph</p>
		
	</body>
	
</html>

*Save with .js extension
Ex:- name.js

*Now link this file to HTML

Inside Body tag

<html>
	<head><title>Hello JS</title>
		
	</head>
	</body>
`		<h1>I am heading</h1>
		<p>I am Paraghraph</p>
		
		<script src="name.js" type="text/javascript">
		</script>
	</body>
	
</html>

*Save with .js extension
Ex:- name.js

*Now link this file to HTML

Tagged : / / / / / /

What is Laravel?

Laravel is a web framework built on PHP. That is the code that has been done by PHP. You can use it to create high-end web applications. That is, you can create a very beautiful web application using variables. The Model View Controller architectural pattern follows the design of Laravel. It is created by Tyler Otwell.

Advance of Laravel

  • Open Source
  • Collection of Tool
  • Save time
  • Improve productivity
  • Robust And Easy
  • Security of the application
  • Authentication
  • Routing
  • Templating

Do You Know?

  • HTML
  • CSS
  • JavaScript
  • SQL
  • PHP OPP
  • MVC
  • Composer

Laravel Requirements

  • PHP 7.2.0 or Higher
  • XAMPP (Apache + MariaDB + PHP + Perl)
  • WAMP/LAMP/MAMP
  • Composer
  • Text/code Editor – Notepad++, vs code, ATOM, Brakets
  • Web Browser – Google Chrome, Mozilla firefox,edge

Tagged : / / / / / /

Define PHP and How to work?

Type of website:-

A static page is called that in which the information that is there is in the name of every user. You cannot change anything in a static page. It is only used to see information.

Dynamic website:-

Dynamic website is user-friendly, user can interact with it. The page in which the user can interact is called a dynamic website. Like submitting a form by filling in a web page. In this, each user gives different information, the user who enters the information gets the same result.

How PHP works?

There is a client who sends a request or works to visit a website.

web server

The webserver provides us this facility which will be there for 24 hours. So that your client will be able to send that request by any time difference and its corresponding web server will be able to respond to it. A server will run in the webserver which you call Apache server.

This is the web server, this is your small storage in which you have a database created. In which your own server is running which supports PHP. As a programmer, whatever site he has developed is the content of the whole site or is it accessories, They give way by storing them in their web server. You will also create a database so that the user can access it anytime.

client > apache> PHP> database> PHP> Apache> client

Development environment

Operating system – Windows, Linux, Mac, etc.

Web server – XAMP, WAMP, MAMP etc.

Editor/IDE- Notepad, Notepad++, notepad, brackets, eclipse etc.

Web browser – chrome, Firefox etc.

MySQL

MySQL ek database management system hai, is a kind of software in which you write MySQL. MySQL is a software and SQL is a language.

When you install XAMPP, you get:
Apache + MariaDB + PHP + Perl

Apache + MySQL + PHP + Perl

The basic structure of PHP

<?php   opening markup/ Opening tag

php codes;

?> closing markup/ closing tag

Whatever is written between these two is called php code.

We can write Php with HTML

<!DOCTYPE html>
<html>
	<body>
		<h1><body>DevOpsSchool</h1>
	<?php
		echo'hello devopsschool';
	?>
	
	</body>
</html>

How to run on the local server

If you have to run the PHP file in the local server, then first you have to open the XAMMP control panel, then you have to open apache and MySQL in it, this is the first thing. After that you have to go to this puck, then where you have saved the XAMMP file, you have to open the sump file, after that you have to open the htdos. After that you have to go to this PC, then open the file where you have saved XAMPP. After that htdcos has to be opened. Your project will have to create a file, all your files will be made from PHP, HTML, ccs, javascript, audio, images, videos, etc. Then go to your browser and open localhost, then type the name of your project in it and open it. After that, your PHP file will start running.

Tagged : / / / /

What is PHP?

Introduction to PHP

PHP is an open-source server-side programming language, also called the use scripting language, embedding the code of PHP into the code of API HTML. The full form of PHP is Hypertext Preprocessor, its original name is Personal Home Page. It was created by Ramsum Lerdorf in 1994.

Php runs on all platforms like Windows, Linux, Unix, Mac, OS, Etsy.

PHP file ka extension .php

What we can do with PHP?

-Can create dynamic pages with PHP.
-Handle button click, radio button:-
Through PHP you can handle the button click event
-Create database application
-client/server application
-Student Registration
-online course
-online shopping cart
-chat rooms

EXAMPLE:-

<!DOCTYPE html>
<html>
<body>

<?php
	echo"Helllo World";
?>

</body>
</html>

What are client and server?

Client

A client is a piece of computer hardware or software that accesses a service made available by a server. For example, web browsers are clients that connect to the web servers and retrieve web pages for display.

Server

A server is a computer program or a device that provides functionality for other programs or devices, called “client”.

There are many servers like: web server, mail server, print server etc.

Client-server Architecture

Client server Architecture:-

2-Tier Architecture:- A 2 Tire Architecture is where the client talks directly to a server.

3-Tier Architecture:- Middleware

If the client has sent the request to the application server, the application server checks that the request is made by the client. If the request is in its data source, then that application server will respond to your request.

Web Browser and Web Server

Web Browser

The web browser is a client, program, software, or tool through which we sent HTTP requests to a web server. It knows how to communicate whit the server. The main purpose of a web browser is to locate the content on the World wide web and display the web page, images, audio, or video form.

Web Server

A web server can be either a software unit or a hardware unit, which provides the web pages via HTTP. The web server gets the request and finds the resources than the response to the client. The web server provides service only for web applications. All the communication between client (web browser) and server takes place via HTTP.

Web server architecture

Web application

A web application or web app is a client-server software application in which the client runs in a web browser.

What is a Website?

Website is a collection of related web pages that may contain text, images, audio, and video. A website can consist of one page, depending on what the site owner is trying to accomplish.

Tagged : / / / / /

Apache web server Installation Guide, know how to Install Apache web server on Windows 7?

apache-web-server-on-windows-7-installation-guide

After a quick detour to install Notepad++, I’m on my way to installing Magento. Before I can get into the meat of it, though, I do require a few prerequisites.

From the installation instructions, installing Magento requires:

  • Apache 1.3.x or Apache 2
  • PHP 5.2.0 and above with Safe mode off
  • MySQL 4.1.20 and above

After a brief search, I happened upon a very handy site (Yes, my current dev machine runs Windows 7). No sense reinventing the wheel, so these instructions should do nicely.

I’ve chosen the latest stable release, 2.2.17, MD5-verified and ready to install.

Always one to put the right foot forward… The first thing I’ve done is to immediately download the wrong version (src) instead of the neatly prepped installer (msi) as per the instructions. Round 1 goes to my eagerness, but after a neat revisit to the Apache download page, I’m off in the right direction.

After kicking off the Apache installer, my first instinct was to twitch at the frozen installer progress (Did the instructions forget about that ghastly Windows 7 User Account Control?), but after only a brief pause, the UAC prompt has displayed and the Apache web server installation is back on track.

None the worse for wear, time for the next step.

PHP

I’ve pretty much kaboshed most of the PHP installation instructions, mostly due to its avoidance of the handy PHP for Windows installer. Pointing the installer to the Apache web server’s cgi-bin folder seems like a good idea.

A configuration change…

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = “./”
; On windows:
extension_dir = “ext” ; Uncommented (removed the semicolon at the beginning of) this line

… and I’m back to the instructions. After an update to my environment variables, looks like it’s time for a reboot… and sleep.

I’ll be leaving the MySQL install (and testing Apache web server and PHP) ’til tomorrow.

Tagged : / / / / / / / / / / / / / / / / /