How php related to Webform

******************************

WebApplication 

      |

  |-------->html/css/sass/less/Bootstrap/mediaQuery

  

  Js = Programming Langauge ----> Interpreter

  PHP = Programming Langauge -----> PHP Interpreter

  No

  

JS Events

PHP Events X

Page Load


1. Page Load 

|

|---------->Requesting for a Page URL

whenever a page is called(Resource) then browser will a create or make a Request

it will to server       1 sec

C------------------>S <------->Nic Database  select * from marks_table where

| | rollno = zzzzzzzz;

Roll No         |<------------------|

                     return data to 

1 Sec


1. Request Roll No

1. url : login.php

2. url : https://upresults.gov.nic.in/result_announcement/2020/13yu2t3yuwu/showresult.php



Syncronous Programming : All the resources, Devices hardware will wait

and until and 1 response processed.

Asyncronous Programming : Nodejs

All the Resource,Devices,hardware does not to wait

request will be accepted from all but delivered

once which is processed first.


page loading 

1.form submit <form>

2.using Anchor Tag <a>

3.using shadow load [At Network Layer]


Q1. consider a program which js and php code inbuilt together

<h1><?php $arr=[10,20,30,40]?></h1>


<?php print_r($arr);?>

<script>


var arr = [<?php echo 10,",",20;  ?>]; //var arr=[10,20,30]; //jass

console.log(arr); //[10,20,30,40]

console.log(arr);// string

<script>

1. Complete the Code at line 501

Answer : js it work on text or Tag

request ---->page call --->resource --->MIME TYPE ---->File (.php)--->Apache

php:// [Interpreter]

           |

   |----------->php code 

|

|------->plain Text

                                           |

   |-------->Browser

|-----Plain +HTML Tag

DOM TREE

   |----------->Javascript

   

wap a program to dynamically accept the input from form

and display on Another Page.


Filename :input.php


steps 1: Analyse page load Event


step 2: 

if it is using <form Tag>

1. action attribute <form action="output.php" >

if action="" is self or empty 

action="input.php" or action=""

submit the form at this location

action="#" --->

url :input.php#

# is called fragment Identifier

#home

#aboutus

#inbox

and will be a key concept spa application (single page Application).

navigator location Api # ---> /

gmail.com/inbox routing in spa

spa framework

href="javascript:alert('Hello I am Alert');"

<a href="javascript:alert('Hello');">alert</a>

2. if action is availble onsubmit attribute is checked

<form action="output.php" onsubmit="return false;">

Task: Perform Cleint side validation onsubmit attribute

name 1Blank 

mobile blank and length

email type="text" empty and @ .

 

3. After client side data is validated 

1.  How to sent the data to the server on clicking submit button

2.  How to sent the data to the server without submit button

Ajax <input type="button">

    

    4. Considering submit from submit button

1. Identify the method type by default method is Get Type

<form action="output.php" onsubmit="return validate();" method="get">

<form action="output.php" onsubmit="return validate();" method="GET">

<form action="output.php" onsubmit="return validate();" >

By default Method is Get





Method is POST