0% found this document useful (0 votes)
11 views12 pages

Legally-Flowchart Mermaid

Uploaded by

Kaustubh Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views12 pages

Legally-Flowchart Mermaid

Uploaded by

Kaustubh Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 12

###upload

Html

<form action="upload.php" method="post" enctype="multipart/form-data">


<input type="file" name="resume" accept=".txt" required>
<button type="submit" name="submit">Upload</button>
</form>

//input enctype="multitype/form-data"

<? Php
If(isset($_POST['submit']){
//no $_POST
$file=$_FILES['resume'];

$content = file_get_contents($file['tmp_name']);
//the only go to function you need >>>>>>
$filename = basename($file['name']);
//2 basic commads

$lower = strtolower($content);
//sensitivity bhee I can
foreach ($web_skills as $skill) {
if (strpos($lower, $skill) !== false) {
$category = "Web_Developer_Resumes";
break;
}
}

$destination = $category . "/" . $filename;

if (move_uploaded_file($file['tmp_name'], $destination)) {
echo "Resume uploaded and categorized into: <strong>$category</strong>.";
} else {
echo "Failed to upload file.";
}

}
Fof worth
"millponds
yam action: "e" method: apostil enctype
input types" fallen name." accept "tatu reems
*
ate
- Hay
needle
<?php
if (isset($_POST['submit'])) {
$file = $_FILES['resume'];
//samjha $_FILE[]
//IS A GLOBALATTRIBUTE
// Check file type
$content = file_get_contents($file['tmp_name']);//LETS see

//the only go to function you need >>>>>>


$filename = basename($file['name']);
//what is this

// Skill matching
$web_skills = ["php", "javascript", "python"];
///make a non asociative array for comparitive analysis
$data_skills = ["data science", "machine learning"];

$category = "";

$lower = strtolower($content); // Make case-insensitive

// Check for keywords


foreach ($web_skills as $skill) {
if (strpos($lower, $skill) !== false) {
$category = "Web_Developer_Resumes";
break;
}
}

if ($category == "") {
foreach ($data_skills as $skill) {
if (strpos($lower, $skill) !== false) {
$category = "Data_Scientist_Resumes";
break;
}
}
}

// If no category matched
if ($category == "") {
echo "No relevant skills found. Resume not categorized.";
exit;
}

// Move the file to the right folder


$destination = $category . "/" . $filename;
if (move_uploaded_file($file['tmp_name'], $destination)) {
echo "Resume uploaded and categorized into: <strong>$category</strong>.";
} else {
echo "Failed to upload file.";
}
}
?>

####basic form
<!DOCTYPE html>
<html>
<head>
<title>Event Registration Form</title>
</head>
<body>
<h2>Register for Events</h2>
<form method="post">
<label>Full Name:</label><br>
<input type="text" name="fullname" required><br><br>

<label>Email:</label><br>
<input type="email" name="email" required><br><br>

<label>Phone Number:</label><br>
<input type="text" name="phone" required><br><br>

<label>Password:</label><br>
<input type="password" name="password" required><br><br>

<label>Confirm Password:</label><br>
<input type="password" name="confirm_password" required><br><br>

<label>Select Events:</label><br>
<input type="checkbox" name="events[]" value="Workshop"> Workshop<br>
<input type="checkbox" name="events[]" value="Seminar"> Seminar<br>
<input type="checkbox" name="events[]" value="Networking"> Networking<br><br>

<button type="submit">Register</button>
</form>

</body>
</html>

<?php
$errors = [];
$success = "";

if ($_SERVER["REQUEST_METHOD"] === "POST") {


$fullname = trim($_POST["fullname"]);
$email = trim($_POST["email"]);
$phone = trim($_POST["phone"]);
$password = $_POST["password"];
$confirm_password = $_POST["confirm_password"];
$events = isset($_POST["events"]) ? $_POST["events"] : [];

// Validations
if (empty($fullname) || empty($email) || empty($phone) || empty($password) ||
empty($confirm_password)) {
$errors[] = "All fields are required.";
}

if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$errors[] = "Invalid email format.";
}

if (!is_numeric($phone) || strlen($phone) != 10) {


$errors[] = "Phone number must be numeric and 10 digits long.";
}

if (strlen($password) < 8) {
$errors[] = "Password must be at least 8 characters long.";
}

if ($password !== $confirm_password) {


$errors[] = "Passwords do not match.";
}

if (empty($events)) {
$errors[] = "Please select at least one event.";
}

// Send Email if no errors


if (empty($errors)) {
$to = "[email protected]"; // Change to your destination email
$subject = "New Event Registration";
$message = "Name: $fullname\nEmail: $email\nPhone: $phone\nEvents: " .
implode(", ", $events);
$headers = "From: $email";

if (mail($to, $subject, $message, $headers)) {


$success = "Registration successful! Confirmation email sent.";
} else {
$errors[] = "Error sending email.";
}
}
}
?>

<?php
// Display errors
if (!empty($errors)) {
echo "<ul style='color:red;'>";
foreach ($errors as $err) {
echo "<li>$err</li>";
}
echo "</ul>";
}

// Success message
if ($success) {
echo "<p style='color:green;'>$success</p>";
}
?>

##xml
<?xmlversion="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.bharaththippireddy.org/order"
xmlns:tns="http://www.bharaththippireddy.org/order">
<element name="order" type="tns:order" />
<complexType name="order">
<sequence>
<element name="customer" type="tns:customer" />
<element name="product" type="tns:product" minOccurs="1"
maxOccurs="unbounded" />
</sequence>
<attribute name="id" type="tns:ID" />
</complexType>
<complexType name="customer">
<sequence>
<element name="name" type="string"/>
<element name="phone" type="string" minOccurs="0"/>
</sequence>
<attribute name="id" type="tns:ID" />
</complexType>
<complexType name="product">
<sequence>
<element name="name" type="tns:string20chars" />
<element name="description" type="int"/>
<element name="price" type="tns:string100chars" />
<element name="category" type="tns:category" />
</sequence>
<attribute name="id" type="tns:ID" />
</complexType>
<simpleType name="string20chars">
<restriction base="string">
<maxLength value="20"/>
</restriction>
</simpleType>
<simpleType name="string100chars">
<restriction base="string">
<maxLength value="100" />
</restriction>
</simpleType>
<simpleType name="category">
<restriction base="string">
<enumeration value="electronics" />
<enumeration value="books"/>
<enumeration value="shoes" />
</restriction>
</simpleType>
<simpleType name="ID">
<restriction base="int">
<maxInclusive value="50"/>
</restriction>
</simpleType>
</schema>
<!ELEMENT bookstore (book+)>
<!ELEMENT book (title)>
<!ATTLIST book id CDATA #REQUIRED>
<!ELEMENT title (#PCDATA)>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookstore SYSTEM "books.dtd">
<bookstore>
<book id="90">
<title>B1</title>
</book>
<book id="900">
<title>Wjb</title>
</book>
</bookstore>
07 April 2025 07:07
daily updates Page 1
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="books.xsl"?>
<bookstore>
<book id="90">
<title>B1</title>
</book>
<book id="900">
<title>Wjb</title>
</book>
</bookstore>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--Output as HTML -->
<xsl:output method="html" indent="yes"/>
<!--Template for root element -->
<xsl:template match="/">
<html>
<head>
<title>Bookstore Inventory</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
color: darkblue;
}
.book {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
background-color: #f9f9f9;
border-radius: 5px;
}
</style>
</head>
<body>
<h1>Bookstore Inventory</h1>

<!--Loop through each book -->


<xsl:for-each select="bookstore/book">
<div class="book">
<p><strong>Book ID:</strong> <xsl:value-of select="@id"/></p>
<p><strong>Title:</strong> <xsl:value-of select="title"/></p>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

#php file
<!DOCTYPE html>
<html>
<head>
<title>Read Resume File</title>
</head>
<body>
<h2>Read and Display Resume Data</h2>
<form method="post">
<label>Enter file name (e.g., resume.txt):</label>
<input type="text" name="file" required>
<button type="submit">Read File</button>
</form>

<?php
if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["file"])) {
$filename = $_POST["file"];

if (file_exists($filename)) {
$file = fopen($filename, "r");
$dataArr = [];

while (($line = fgets($file)) !== false) {


$line = trim($line); // remove extra whitespace
$parts = explode(",", $line);

if (count($parts) === 3) {
$name = trim($parts[0]);
$age = (int) trim($parts[1]);
$gender = trim($parts[2]);

$dataArr[$name] = [
"age" => $age,
"gender" => $gender
];
}
}

fclose($file);

// Sort descending by age


uasort($dataArr, function($a, $b) {
return $b["age"] - $a["age"];
});

echo "<h3>Sorted Resume Data:</h3>";


echo "<ul>";
foreach ($dataArr as $name => $info) {
echo "<li><strong>$name</strong> - Age: {$info['age']}, Gender:
{$info['gender']}</li>";
}
echo "</ul>";

} else {
echo "<p style='color:red;'>File not found: $filename</p>";
}
}
?>
</body>
</html>

####js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Single-Page Navigation</title>
<style>
/* Basic reset and page styling */
* {
margin: 0;
padding: 0;
box-sizing: border-box;

}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
padding: 20px;
max-width: 1000px;
margin: 0 auto;
}

/* Navigation styling */
nav {
background-color: #333;
padding: 10px;
margin-bottom: 20px;
}
nav ul {
display: flex;
list-style: none;
}
nav a {
color: white;
text-decoration: none;
padding: 10px 15px;
}
nav a.active {
background-color: #4CAF50;
border-radius: 4px;
}

/* Section styling */
.page-section {
display: none;
padding: 20px;
border: 1px solid #ddd;
border-radius: 4px;
}
.page-section.active {
display: block;
}

h1 {
margin-bottom: 15px;
}
p {
margin-bottom: 10px;
}
</style>
</head>
<body>
<!-- Navigation Menu -->
<nav>
<ul>
<li><a href="#home" class="nav-link active"
data-section="home">Home</a></li>
<li><a href="#about" class="nav-link"
data-section="about">About</a></li>
<li><a href="#services" class="nav-link" data-
section="services">Services</a></li>
<li><a href="#contact" class="nav-link" data-
section="contact">Contact</a></li>
</ul>
</nav>

<!-- Page Sections -->


<div id="home" class="page-section active">
<h1>Home Page</h1>
<p>Welcome to our website! This is the home page section.</p>
<p>Click on the navigation links above to switch between different sections
without page reload.</p>
</div>

<div id="about" class="page-section">


<h1>About Us</h1>
<p>This is the about section of our single-page application.</p>
<p>Here you can learn more about our company and team.</p>
</div>

<div id="services" class="page-section">


<h1>Our Services</h1>
<p>We offer the following services:</p>
<ul>
<li>Web Development</li>
<li>Mobile App Development</li>
<li>UI/UX Design</li>
<li>Digital Marketing</li>
</ul>
</div>

<div id="contact" class="page-section">


<h1>Contact Us</h1>
<p>You can reach us at:</p>
<p>Email: [email protected]</p>
<p>Phone: (123) 456-7890</p>
</div>

<!-- JavaScript for navigation -->


<script>
// Wait for the DOM to fully load before running our code
document.addEventListener('DOMContentLoaded', function() {

// 1. Get all navigation links


const navLinks = document.querySelectorAll('.nav-link');

// 2. Get all page sections


const sections = document.querySelectorAll('.page-section');

// 3. Function to show a specific section


function showSection(sectionId) {
// A. Hide all sections first
sections.forEach(function(section) {
section.classList.remove('active');
});

// B. Show the target section


document.getElementById(sectionId).classList.add('active');

// C. Update active state in navigation


navLinks.forEach(function(link) {
if (link.getAttribute('data-section') === sectionId) {
link.classList.add('active');
} else {
link.classList.remove('active');
}
});
}

// 4. Add click event listeners to all navigation links


navLinks.forEach(function(link) {
link.addEventListener('click', function(event) {
// A. Prevent the default link behavior (page reload)
event.preventDefault();

// B. Get the section ID from the data-section attribute


const sectionId = this.getAttribute('data-section');

// C. Update the URL hash for browser history/bookmarking


window.location.hash = sectionId;

// D. Show the selected section


showSection(sectionId);
});
});

// 5. Handle page load and browser history navigation


function handleHashChange() {
// A. Get the current hash value without the # symbol
let currentHash = window.location.hash.substring(1);

// B. If no hash is present, default to 'home'


if (!currentHash) {
currentHash = 'home';
}

// C. Show the appropriate section


showSection(currentHash);
}

// 6. Listen for hash changes (browser back/forward buttons)


window.addEventListener('hashchange', handleHashChange);

// 7. Handle the initial page load


handleHashChange();
});
</script>
</body>
</html>
###phpmy sql
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

$sql = "INSERT INTO MyGuests (firstname, lastname, email)


VALUES ('John', 'Doe', '[email protected]')";

if ($conn->query($sql) === TRUE) {


echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?>

###append child
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Append and Delete Example</title>
<style>
#item-list li {
margin: 5px 0;
padding: 6px 10px;
background: #f0f0f0;
border-radius: 4px;
display: flex;
justify-content: space-between;
align-items: center;
}
button {
margin-left: 10px;
}
</style>
</head>
<body>

<h2>Todo List</h2>
<input type="text" id="item-input" placeholder="Add item" />
<button id="add-btn">Add</button>

<ul id="item-list"></ul>

<script>
const addBtn = document.getElementById("add-btn");
const input = document.getElementById("item-input");
const itemList = document.getElementById("item-list");

addBtn.addEventListener("click", () => {
const value = input.value.trim();
if (value !== "") {
// Create list item
const li = document.createElement("li");
li.textContent = value;

// Create delete button


const deleteBtn = document.createElement("button");
deleteBtn.textContent = "Delete";
deleteBtn.addEventListener("click", () => {
li.remove(); // Remove the list item
});

// Append delete button to list item


li.appendChild(deleteBtn);

// Append list item to the list


itemList.appendChild(li);

// Clear input
input.value = "";
}
});
</script>

</body>
</html>

You might also like