abc

Share This blog with your friends, so that we can improve more & more . our aim is to easy & simple way of learning.

12/16/2020

How to add captcha - to verify user (image or text capatcha) using html, php, javascript

 step 1) go to google recaptcha website create key from here , which is require for third & fourth step.


step 2)add script between head tag- <script src="https://www.google.com/recaptcha/api.js"></script>


step 3)<div class="g-recaptcha brochure__form__captcha" data-sitekey="YOUR SITE KEY"></div>


step 4) just use below php code.

 <?php

function reCaptcha($recaptcha){

  $secret = "YOUR SECRET KEY";

  $ip = $_SERVER['REMOTE_ADDR'];


  $postvars = array("secret"=>$secret, "response"=>$recaptcha, "remoteip"=>$ip);

  $url = "https://www.google.com/recaptcha/api/siteverify";

  $ch = curl_init();

  curl_setopt($ch, CURLOPT_URL, $url);

  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

  curl_setopt($ch, CURLOPT_TIMEOUT, 10);

  curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);

  $data = curl_exec($ch);

  curl_close($ch);


  return json_decode($data, true);

}


$recaptcha = $_POST['g-recaptcha-response'];

$res = reCaptcha($recaptcha);

if($res['success']){

   // go to page

}



 ?>

 

step 5) test it.

Technology Question and answer

 1) Font style tabs in HTML are also known as

- navigation Or menu or scrollspy.


2) Syntax of writing a different font style in HTML

font: normal 12px aerial;

font-family : aerial, sans serif;

font-size: 15px;



get font family from google font https://fonts.google.com/


apply above style for body tag to whole page affect.


3) Which HTML tag is used to give strikethrough effect to text?

for html 4 use <strike>


for html 5 use below example <del> tag 


<!DOCTYPE html>

<html>

<body>


<h1>The del element</h1>


<p>My favorite color is <del>blue</del> <ins>red</ins>!</p>


</body>

</html>



4) What is best site to get HTML templates?

template means design which are ready to use.


themeforest, templatemonster, colorlib


should check whether is responsive or not, it is good thing for SEO


5) How to send email of HTML output?

use PHP mail function

mail($from, $to, $sub, $message);


6) Explain the various attributes necessary to insert drop down list in a HTML page

already post on this same blog 

https://learn-infyleaf.blogspot.com/2020/12/how-to-create-navigation-menu-using.html


7) How to add a app icon in my app with HTML?

visit link - 

https://learn-infyleaf.blogspot.com/2020/12/how-to-create-icons-like-social-media.html


8) How to apply HTML code on our blogs website?

go to theme option - customize - drop down - edit html , change and ensure click on update button


9) Write a HTML program to design a simple website using image and hyperlink

<body>

<img src="abc.jpg" onclick="location.href='mylocation.html'" />


OR 


<p><a href="mylocation.htm"><img src="abc.jpg" /></a></p>


</body>


10) Various design requirements in HTML and approaches to design Web pages

- editor like notepad++, dreamviewver, visual studio. all browser, laptop and mobile to test responsive and works all browser.


11) How to HTML page working on the browser in internal working both English and Hindi?


three method

1) use google translator , which translate original website to various language not only English or Hindi.

2) using site https://mothereff.in/html-entities add your Hindi content and use converted entities in html.

3) use web font like google font



12) The code for inserting an image in an HTML page is imagsrc alt The alt attribute .

<img src="abc.png" alt="sample image" />


13) I design one HTML page but my laptop don't support the center alignment ?


use align="center"

or add margin : 0px auto ;  - style center div position.


14) How to create quiz in HTML with timer?

- use javascript setinterval to start clock, and in clock function set -1 to reverse original time.

- add option using checkbox, link with mysql, just match correct value of checkbox to database value

- count correct answer & wrong answer in php loop & that's set quiz is ready.


15) Open source tools that can be used in project of computer science and engineering can be related to Web development

github have lot of tools or contact us we will to make project.


Is it possible to have two levels of subscript in HTML 5 document in the same line?

 It is possible just write subscript or superscript level means subscript within subscript.


<!DOCTYPE html>

<html>

<body>

<h1>The sub and sup elements</h1>

<p>This text contains <sub>subscript<sub>a</sub></sub> text.</p>

</body>

</html>


another example a<sub>b<sub>c</sub></sub> - useful to math calculation


(a2)2  suppose this is mathematics format - <div>(a<sup>2<sup>)<sup>2</sup></div>


The enhanced features of HTML5

 1) editing content using 'content editable' 

 <h2 contenteditable=true>You can edit me</h2>

 

2) figure and figure caption added in latest html5

<figure>

    <img src="http://static1.tothenew.com/blog/wp-content/uploads/2017/03/productimg.png">

    <figcaption>

    <p>Image of birds</p>

    </figcaption>

</figure>


3) verify textbox using pattern or regular expression

<input type="text"  name="rollno"  pattern="[0-9]{5}" >


4) SVG elements - create scalable vector graphics.


5) Webfont - font-family style available , lots of google are free to use, which makes more better look of website.


6) animation and transition effect -using CSS different animation can do , like flipping a book.


7) audio and video new tag introduce

<audio autoplay="autoplay" controls="controls">

    <source src="file.ogg" />

    <source src="file.mp3" /> 

    <a>Download this file.</a>

</audio>


8) localstorage can be done.

How to create payment billing system project in Javascript?

 Payment billing system maintain product bill & this can be handle using private link , link which is only share within office area or user of this system. 


Logic of system -

1) when open link there are at least two user one is admin and other is normal operator.

2) ask for login - after login success there will be two pages one for admin login and one for normal user login. system checks if correct password enter or not, if it's correct go to page dashboard.

3) dashboard have multiple functionality available like add, update, delete data, print data, create report, sorting, searching, checking.

4) if admin is login then there will be all access like register , block or allow user, update, delete & all. in case user login only option to add , check , print report & give bill customer


language required,

For frontend design - html , css, bootstrap

For backend Design - javascript, php ,mysql , sqlite


Note - ensure link NOT search for SEO, encrypt data, page load in 2-3 second.


Steps

i) Define and Plan

This step includes clarifying the purpose and end goals for the application. define the problem you want to solve with a web application and then gather relevant information about it.


ii) Design and build 

design frontend tool and build all functions. and check with first step if all design function added . if any point fail or pending note down for feature scope & add this for next version.


iii) testing

testing is phase of all functions and module works well, check bugs or error if any, remove unwanted code or anything. check keyboard interface , user- friendly , calculate time.


iv) host on real 

take hosting and add this billing system , as this is online solution, which works on all devices, not restrict for OS .


please comment for more detail about this project and web application.


An Introduction to the Laravel Framework: What It Is and Why You Should Use It

  If you're a PHP developer looking for a modern, efficient, and powerful framework to build web applications, look no further than Lara...