Posts

Showing posts with the label html

How to show current date in Html date field

Image
 Date field default date in HTML      In this tutorial, we learn How to set up current date as a default date value in HTML date field using JavaScript. It is visible when a page is loaded. Here is an example: In this code, we used the JavaScript date to generate a date and set that date to the HTML date field. MOVETOP↑   index.php   <html> <head> <title> Codingzon Tutorials </title> <body bgcolor= "" > <center> <p id= "datetime" > </p> <form> Current Date: <input type= "date" name= "date1" id= "date1" plaseholder= "Date1" ><br/> </form> <script>   // ***************** Get current date and time in JavaScript ***************** // var now = new Date (); // reading each part of datetime var day = now.getDate(); var month = now.getMonth() + 1 ; var year = now.getFullYear(); if (month < 10 ) month = "0...

How to read txt file into Html Dropdown

Image
Read content/data from text file and write it into HTML Dropdown           This blog demonstrates how to populate a dropdown list with values from a text file using PHP. This tutorial uses two files.   1. states.txt : The text file contains a set of rows. Each row contains a state information such as  stateID, stateName , stateCapital , statePopulation   etc. and each value in a row, separated with semicolon . Other variations are possible to store states info ex: CSV, but in this tutorial our goal is reading a text file and populating data in an HTML dropdown. The first line in the states.txt file contains the columns names. The next five rows are the data. As shown below, link. states.txt  2. demo1.php : Displays text data in a dropdown.  There are 3 steps implemented in this file step1 -  Reads the sates text file and stores states details in an array. step2 - There is an HTML form with one dropdown. All array data is l...

How to Stop and Start HTML Marquees

Image
   Stopping and Starting HTML Marquees       How to pause scrolling text that is created with HTML <marque> tag , when the user hovers over on it, It needs to continue when mouse out of the scrolling text.  i.e, Pausing a scrolling marquee text, ex: news article, when the user moves the mouse on it and should start scrolling again when the mouse is out of that text. Ex: <marquee behavior= "scroll" direction= "right" onmouseover= "this.stop();"   onmouseout= "this.start();" >   <h3> Go on… hover on this text (and hold the mouse over)! </h3>   </marquee>     More on HTML Marquee tag    Marquee tag allows you to create a scrolling text on a webpage. HTML provided different.  attributes for adding additional properties to scrolling text .      Attributes 1. behavior Indicate the behavior of how the text scrolls. It can be one of the following.  values: alte...

Adding Google reCAPTCHA Checkbox to Form

Image
How to add Google reCAPTCHA  to Form   Google reCAPTCHA is a widget, it helps to ensure the end user is a human not a robot. It allows preventing sharing information from unauthorized parties. It secures the website from spambots. So every website, it is best to use this widget when sharing the site info to the end users. In this blog, we discuss how to integrate google reCAPTCHA v2 to a PHP website.  Here are the instructions for adding a widget to login form in your web project.   1. Search in google for  'google reCAPTCHA v2 '. 2.  Sign in to google reCAPTCHA. 3. In admin settings, click (+) to create a new captcha for your site 4. It opens new window, enter all the details and click submit 5. In the dashboard, select recently created site from the dropdown, click settings(gear icon) 6. Copy reCAPTCHA keys and add in the program. That's all you need to do.   Create an index.php and copy the entire code below given in the index file, save it in a pro...

Login Check Module using PHP and HTML

Image
Implementing Login Check using PHP and HTML         In this article we are going to learn how to create a simple Login form using HTML and How to check Login is successful or invalid using PHP Coding .  So create a file called login.php and copy and paste the below code and save it on the server, in some folder. In this file you will see 2 parts. One is the login form code and above the PHP code.  Login form having form tag with name, action, method attributes. Next 2 input tags, one is username - text box- called 'username' and another input tag type password and its name is 'password'. Another input tag is Submit button.  When the User submits the form, then the data the user submitted (username, password) will be transmitted to the server in the form of the post method. PHP checks whether the Submit button is clicked or not, then reads those posted values using name attributes and stores them in PHP variables. Next, It compares them with ...

Basic registration form for Signup-PHP

Image
      Learn How to Develope Basic registration form for Signup in PHP and HTML     In this article we are going to learn how to create a basic registration form and connect with PHP . Generally the registration form  method is always 'post'. Post method will submit the user data in a secured manner.  To read from post data PHP uses $_POST inbuilt array.  The below example lets you know how  to read data from various types of form controls and print it in PHP.                   Move Up registration-form.php     <!doctype html> <html lang= "en" > <head> <title> e-trainings Demo - creating registration form using PHP,HTML </title> <meta charset= "utf-8" > </head> <body> <?php if ( isset ( $_POST [ 'submit' ])) { print "<h2>Your details are as follows :</h2><br>" ; echo "username: " ....

How to create HTML-Forms

Image
   Learn how to use HTML form controls In this article we are going to learn How to use basic html-form controls for creating different kinds of forms. For any websites It should have at least one or two forms in the site in order to communicate with the client and share information and views of the users, which helps them to take their business up one level. So If we come to the topic, html provides various graphical user-interface controls for creating forms which allows users to feed different kinds of data. Now we learn what those controls are and how to use them etc. In this tutorial we will create the various forms one by one which are more frequently used in websites. 1) login page 2) signup page using following html controls: Radio buttons : Radio buttons allow users to choose only one option among the group. ex: Gender Checkbox : Checkbox allows users to choose all options from the group. ex:Hobbies C ombo box: Combo box also called it as drop down . It holds a...