This commit is contained in:
boris
2025-02-06 12:30:01 +00:00
parent f30a8fe711
commit f64a9eadbe
176 changed files with 21418 additions and 0 deletions

8
php-s1/workshop2/.idea/.gitignore generated vendored Executable file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1,21 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="7">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
<item index="3" class="java.lang.String" itemvalue="noscript" />
<item index="4" class="java.lang.String" itemvalue="embed" />
<item index="5" class="java.lang.String" itemvalue="script" />
<item index="6" class="java.lang.String" itemvalue="head" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
</profile>
</component>

6
php-s1/workshop2/.idea/jsLibraryMappings.xml generated Executable file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="PROJECT" libraries="{@types/bootstrap, bootstrap}" />
</component>
</project>

8
php-s1/workshop2/.idea/modules.xml generated Executable file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/workshop2.iml" filepath="$PROJECT_DIR$/.idea/workshop2.iml" />
</modules>
</component>
</project>

20
php-s1/workshop2/.idea/php.xml generated Executable file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.3" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

10
php-s1/workshop2/.idea/workshop2.iml generated Executable file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="@types/bootstrap" level="application" />
<orderEntry type="library" name="bootstrap" level="application" />
</component>
</module>

19
php-s1/workshop2/index.css Executable file
View File

@@ -0,0 +1,19 @@
body {
outline: 1px solid black;
padding: 10px;
width: fit-content;
height: fit-content;
}
#main * {
margin-bottom: 15px;
}
#radio {
outline: 1px solid black;
width: fit-content;
}
#radio * {
margin: 5px;
}

28
php-s1/workshop2/index.html Executable file
View File

@@ -0,0 +1,28 @@
<head>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<title>Passing Data</title>
</head>
<body>
<p><strong>Please enter your details below:</strong></p>
<form name="form1" method="post" action="passingdata.php">
<div id="main">
<label>First Name:
<input type="text" name="firstname">
</label>
<label>Surname:
<input type="text" name="surname">
</label>
<div id="radio">
<label>CS <input type="radio" name="course" value="CS"/> </label>
<label>SE <input type="radio" name="course" value="SE"/> </label>
<label>MIT <input type="radio" name="course" value="MIT"/> </label>
</div>
<label>Living on Salford Campus<input type="checkbox" name="onCampus"></label>
<br>
<input type="submit" name="Submit" value="Submit"/>
<input type="reset" name="Reset" value="Reset"/>
</div>
</form>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" integrity="sha384-w1Q4orYjBQndcko6MimVbzY0tgp4pWB4lZ7lr30WKz0vr/aWKhXdBNmNb5D92v7s" crossorigin="anonymous"></script>
</body>

20
php-s1/workshop2/index.php Executable file
View File

@@ -0,0 +1,20 @@
<body>
<div>
<p><strong>Please enter your name and birthday:</strong></p>
<form name="form1" method="post" action="passingdata.php">
<span>
<label>Your name:
<input type="text" name="name">
</label>
<br>
<label>Your Birthday (in DD/MM/YY format):
<input type="text"
name="birthday" required>
</label>
<br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</span>
</form>
</div>
</body>

View File

@@ -0,0 +1,44 @@
<body>
<span>
<?php
$birthday = $_POST['birthday'];
$test_array = explode("/", $birthday);
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$course = $_POST['course'];
$onCampus = $_POST['onCampus'];
echo "Hello, $firstname $surname";
echo "<br>";
if (isset($_POST["birthday"])) {
if (count($test_array) == 3) {
if (checkdate($test_array[0], $test_array[1], $test_array[2])) {
if (($test_array[2]-2024)<-100) {
echo "Birthday: $birthday";
echo "<br>";
}
else {
echo "Over 100 years old";
}
}
else {
echo "Birthday in Incorrect Format";
echo "<br>";
}
}
}
echo "Course: $course";
echo "<br>";
echo "On Campus: ";
if (isset($_POST['onCampus'])) {
echo "True";
} else {
echo "False";
}
?>
<br>
<a href="index.html"><button>Return to Form</button></a>
</span>
</body>