Web Development Record Algorithms
Web Development Record Algorithms
Web Development Record Algorithms
1. Set up HTML structure with <!DOCTYPE html>, <html>, <head>, and <body> tags.
2. Set document title in the <title> tag inside the <head> section.
3. Use <marquee> tags in the <body> section to create scrolling text effects.
4. Specify attributes (if any) within <marquee> tags to control scrolling speed and direction.
5. Write the text content to be scrolled inside each <marquee> tag.
6. Browser renders the document, applying the specified scrolling effects to the text content.
Program-2:
1. 1.The HTML code consists of <html>, <head>, and <body> tags.
2. 2 Inside the <head> tag, there's a <title> tag setting the title of the document.
3. The <body> tag contains a <table> element representing the timetable.
4. Within the <table> element, there are several <tr> (table row) elements, each
representing a row in the timetable.
5. Inside each <tr> element, there are <th> (table header) elements for the column headers
and <td> (table data) elements for the cells containing subject names.
6. The first row (<tr>) contains column headers denoting the hours of the day.
7. The subsequent rows represent each hour of the day, with cells indicating the subjects
scheduled for that hour.
8. colspan attribute is used to merge cells across multiple columns when necessary.
9. The content within the cells represents the subjects or activities scheduled for each
hour/day of the week.
10. Subjects such as LIB (Library), CLOUD, OE (Open elective), SBS, DA (Data Analysis),
WEB LAB (Web Programming Lab), TRACK (Track Elective), R LAB (Research Lab),
and PROJECT LAB (Project Lab) are scheduled according to the provided timetable.
Program-3:
Program:4:
Program-5:
1.The HTML document starts with <!DOCTYPE html> to specify the document type and
<html lang="en"> to specify the language of the document.
2.The <head> section contains meta tags for character encoding (<meta charset="UTF-8">)
and viewport settings (<meta name="viewport" content="width=device-width, initial-
scale=1.0">), as well as the title of the document specified within the <title> tag.
4. The href attribute of the anchor tag specifies the URL to which the user should be directed
when the link is clicked.
6.The src attribute of the <img> tag specifies the URL of the image to be displayed.
7.The alt attribute provides alternative text for the image, which is displayed if the image cannot
be loaded or by screen readers for accessibility.
8.The width and height attributes specify the dimensions of the image, in pixels.
9.The image file "rose.jpg" is expected to be located in the same directory as the HTML file or in
a directory accessible through the specified URL.
10.If the image file is not found, the specified alternative text will be displayed.
PHP PROGRAM:
1. Define a PHP function named myFamily that takes a last name and a variable number of first
names as parameters.
3. Calculate the number of first names passed to the function and store it in len.
a. Concatenate a greeting message for each family member to the txt variable.
5. After the loop, return the concatenated string txt containing all the greetings.
6. Call the myFamily function with the last name "Doe" and multiple first names ("Jane", "John",
"Joey").
Program-7:(PHP ARRAY)
2. Define a PHP function countWords($str) to count the number of words in a given string.
4. Call reverseString($inputString) to reverse the input string and store the result in
$reversedString.
5. Call countWords($inputString) to count the number of words in the input string and store the
result in $numWords.
6. Output the original input string, the reversed string, and the number of words in the input
string.
1. Display an HTML form with a text input field for entering the user's name.
2. Use the POST method to submit the form data to the same PHP script
($_SERVER['PHP_SELF']).
3. Check if the form has been submitted using
$_SERVER["REQUEST_METHOD"].
4. If the form has been submitted (POST method), proceed with processing the form
data.
5. Retrieve the value entered in the input field using $_REQUEST['fname'].
6. Sanitize the input using htmlspecialchars() to prevent XSS attacks.
7. Check if the input name is empty using empty().
8. If the name is empty, output the message "Name is empty".
9. If the input name is not empty, display the entered name.
PROGRAM:10:
- Initialize it to 1.
- If it exists:
3. Display the current value of the session variable 'counter' as "Page views: [value]".
PROGRAM:11
1.TABLE CREATION:
Create a table client1 with required fields cno,name, add1, add2, city, state, incode, baldue
2.Insertion Algorithm:
Procedure InsertClient
Input: cno, name, add1, city, state, pincode, balancedue
Output: None
1. Prompt the user to input values for cno, name, add1, city, state, pincode, and balancedue.
2. Execute the SQL command to insert the provided values into the client1
table:
INSERT INTO clientmaster1 (cno, name, add1, city, state, pincode, balancedue)
VALUES (cno, 'name', 'add1', 'city', 'state', pincode, balancedue);
1. Display a message indicating the successful insertion of the record.
3.Query Algorithm
Procedure DisplayClients
Input: None
Output: None
1. Execute the SQL command to select all records from the clientmaster1 table:
SELECT * FROM clientmaster1;
2. Display the retrieved records to the user.
PROGRAM:12
1.Procedure ConnectToDatabase
1. Initialize connection parameters for the MySQL database (servername, username, password,
database).
2. Create a new mysqli connection object with the provided connection parameters.
3. Check if the connection was successful:
- If successful, return the connection object (conn).
- If unsuccessful, terminate the program with an error message.
2. Procedure RetrieveDataFromTable
1. Execute an SQL query to select data from the "users" table:
"SELECT id, name, email FROM users".
2. Execute the query using the database connection object (conn).
3. Check if the query returned any results:
- If results are found, return the result set.
- If no results are found, return a message indicating 0 results.
3.Procedure OutputData
1. Check if the result set contains any rows:
- If rows are present, iterate through each row in the result set:
- Display the ID, name, and email of each user row.
- If no rows are present, display a message indicating 0 results.
4.Procedure CloseDatabaseConnection