Skip to main content

Posts

Showing posts from January, 2023

Two difference between table background and table border in HTML and CSS

In this article, we are going to tell about the two differences between table background and table border in HTML. Let's see below. When working with HTML tables, it is important to understand the difference between the table background and table border. The first difference is their purpose. The table background is used to set the background color or image of the entire table, while the table border is used to add a border around the table cells. The background can be set using the "background-color" or "background-image" CSS properties, while the border can be set using the "border" property. <table border="1" bgcolor="green"> <tr> <th>NAME</th> <th>AGE</th> <th>DEPARTMENT</th> </tr> <tr> <td>CHANDRA</td> <td>22</td> <td>CSE</td...

How to Create a Personal details information program using PHP PDO OOP

  In this tutorial, we are going to learn about creating a personal information program using PHP, PDO, and OOP. PHP PDO OOP can be a great way to store and retrieve personal information in a secure. The first step is going to create an HTML form and simple program that allows users to input their personal information, and then display the stored data in a table. And then create a new PHP file, and define a class called 'personalInfo' . The class will use the PDO object passed to its constructor and the constructor is interact with the database. HTML Form allows user to input their personal information and submit the form data and the PHP file class function saved the data in the database. Create a Database Table: create a table personal_info ( id int primary key auto_increment, first_name varchar(50) not null, last_name varchar(50) not null, email varchar(100) not null, address varchar(255) not null ); HTML FORM: <div class="container py-5"...

Difference between sticky forms and self processing forms in PHP

If the website owner or web developer are going to choose to need users' data for security reason or other purposes. You are beginners to know when it comes to gathering information from users in PHP, there are two main types of forms that are commonly used sticky forms. self-processing forms. Both forms have their own advantages and disadvantages, and every developer or website owner is important to understand the difference between them in order to choose the right form for your projects. Read also: How to create a sticky forms in PHP PDO , How to create a self-processing forms in PHP PDO 1. sticky forms A sticky form is a form that maintains the user's inputted data even if the form is submitted incorrectly. If the users forget to fill out any input text or select. It's should be a required field, the form will display an error message and still maintains the user's previously entered data. The forms are easily allowed to correct their error or mistake withou...

How to create self-processing forms in PHP PDO

  Table of contents 1.  Self-processing Form in PHP 2.  why we are using self-processing Form? 3.  PHP PDO Connection 4.  Create a HTML Form 4.1  PHP Form 5  PHP Post Method 5.1  submit.php 6  conclusion In this tutorial, we are going to learn about how to create self-processing forms in PHP PDO.Let's see below. Self-Processing Form in PHP The self-processing form in PHP PDO is useful in the tutorial and this creates forms that submit data to a database, send an email like contact forms or perform other actions without the need for the user to navigate to a different page.   Read also: How to create a sticky from in PHP PDO why we are using self-processing form? Self-processing forms are powerful forms for building dynamic websites and applications. we will explore how to create self-processing forms in PHP using PDO ( PHP Data Objects ). PHP PDO Connection First, we need to set up a database connecti...

How to create a sticky form in PHP PDO

  Table of contents 1. Sticky Form in PHP PDO 2. Create Database Table: 3. sticky form HTML 4. PHP PDO Connection And Stored Data 4.1 SERVER POST METHOD code 4.2 Validation process code 5 Conclusion In this tutorial, we will be going to learn how to create a sticky form in PHP PDO and sticky form easily sanitize the user input before the submission. Let's see the details. Sticky Form in PHP PDO Sticky forms in PHP are a technique used to preserve form data after a form has been submitted. This can be very useful for users in situations where a user has made an error in the form and needs to correct it, or double-check their information before the final submission.    Read also : PHP connect to MySQL Database  We need to create a sticky form in PHP, the first step is to store the form data in variables. First, create a database table named 'users'. These variables can be either $_POST or $_GET , depending on the method used to...

Explain If head and body tag are compulsory on HTML program

In this tutorial, we are going to talk about if the head tag and body tag are important in HTML programs or compulsory to create a web page. Let's see..! The head and body tags are two essential elements of an HTML document. They are used to define the web page structure and content and play an important crucial role in how the web page is rendered by web browsers. The <head> element is used to provide metadata about the document, such as the title of the page, the character encoding, fav icons, schema data, and links to external stylesheets and scripts. This information is not visible to the user but is used by the browser and search engines to understand the content of the page. The <head> element should be placed at the top of the HTML document, immediately after the opening <html> tag. If the information is most important for search engine because the search engine analysis the website and find the category and stores in a particular place to be visible...

How to Create a Personal details information program in HTML

In this tutorial, we are learning how you can create a personal details information program in HTML with the simple using of HTML tags. HTML Form: <div class="container"> <h1 style="text-align:center">Personal Details</h1> <form class="form-control"> <label for="name">Name:</label><br> <input type="text" id="name" name="name"><br> <label for="email">Email:</label><br> <input type="email" id="email" name="email"><br> <label for="dob">Date of Birth:</label><br> <input type="date" id="dob" name="dob"><br> <label for="gender">Gender:</label><br> <input type="radio" id="gender" name="gender" value="male...

Python break and continue with examples

In this tutorial, on how to create a python the break and continue statements are used to alter the flow of a loop. The break and continue statement is used for optimizing the code and making it more readable by breaking out of a loop anytime.   Read also: Python Flask tutorial Setting up a Flask and SQL Database Connection   How to create a python flask with mysql database    Python 'break' statement The 'break' statement is used to exit a loop prematurely.  Python break syntax:   break When a break statement is encountered within a loop, the loop is immediately terminated and the program control paused or resumes at the next statement following the loop. For Example: for i in range(10): if i == 6: break print(i) output: 0 1 2 3 4 5 In the above code, the loop will iterate over the range 0 to 9. For Example: if i == 5: break When the value of the 'if' statement increased becomes '6', the 'break' statemen...

Python while loop with Examples

In this tutorial, we are going to learn how to create a python while loop with the examples and Python's while loop allows you to repeatedly execute a block of code as long as a certain condition is 'true' .   Python while loop syntax: while condition: code block The code block within the while loop will be executed as long as the condition is 'True' . It is important to include a way to change the value of the condition within the code block, or else the loop will never end and you'll be stuck in an infinite loop. Python while loop with Examples below see the codes.   Read Also: Python Flask tutorial Setting up a Flask and SQL Database Connection   Here's an example of a simple while loop in action: count = 0 while count < 5: print("Execute loop", count) count = count + 1 Output: Execute loop 0 Execute loop 1 Execute loop 2 Execute loop 3 Execute loop 4 This while loop will print out the numbers 0 through 4, beca...

Python for Loop with Examples

In this tutorial, we will learn how to use a for loop in python and types with examples. Python for loops is used to iterate over a sequence ( such as a list, tuple, or string ) or other iterate object and execute a block of code for each item in the sequence. This can be a very powerful tool for performing tasks on data and is a crucial part of programming in Python. If I am printing or executing multiple lines of data, we can use a loop.It's super easy to print. And There are two types of loops in python: for loop while loop   Python for loop: To use a for loop in Python, you use the following syntax:   for item in sequence: # code to be executed for each item Here, the above runs a block of code a certain number of times. Each item of the sequence on each iteration is loop continuously until reaching the last item in the sequence.    Read also : student registration form a python with database Python loop list: Here's an example of a for loop that i...

Python - if, else, elif Statements (With Examples)

In this tutorial, we are going to learn about the python if..else..elif statement with the help of examples and am using pycharm to execute the command and create some decision-making programs. The if statement in Python allows you to specify a block of code to be executed if a certain condition is satisfied. Here we use the statement and give value to the output return when a certain condition is met and extract the block code. Read also : student registration form a python with database   For example: In school, the student gets results based on the marks. if the student marks get above 35 marks, the output is a pass and if the student gets below 35 marks, the output is a fail. same process as the Assigning in grades systems like A,B,C,D,E based on the marks obtained by a student. In Python , there are three types of forms in if...else statement if statement if.. else statement if ...elif...else statement    Python if statement student = 45 # Here the check if nu...