Compare commits

...

No commits in common. "mpabi" and "bartoszh" have entirely different histories.

11 changed files with 28 additions and 178 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
*.swp

View File

@ -1,60 +0,0 @@
body {
/* Center the form on the page */
text-align: center;
}
form {
display: inline-block;
/* Form outline */
padding: 1em;
border: 1px solid #ccc;
border-radius: 1em;
}
p + p {
margin-top: 1em;
}
label {
/* Uniform size & alignment */
display: inline-block;
min-width: 90px;
text-align: right;
}
input,
textarea {
/* To make sure that all text fields have the same font settings
By default, textareas have a monospace font */
font: 1em sans-serif;
/* Uniform text field size */
width: 300px;
box-sizing: border-box;
/* Match form field borders */
border: 1px solid #999;
}
input:focus,
textarea:focus {
/* Additional highlight for focused elements */
border-color: #000;
}
textarea {
/* Align multiline text fields with their labels */
vertical-align: top;
/* Provide space to type some text */
height: 5em;
}
.button {
/* Align buttons with the text fields */
padding-left: 90px; /* same size as the label elements */
}
button {
/* This extra margin represent roughly the same space as the space
between the labels and their text fields */
margin-left: 0.5em;
}

View File

@ -4,60 +4,33 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <title>Document</title>
<link rel="stylesheet" href="css/style.css">
</head> </head>
<body> <body>
<form action="/my-handling-form-page" method="post"> <section>
<p> <p> test </p>
<label for="Lastname">LastName:</label> <form action="/my-handling-form-page" method="post">
<input type="text" id="Lastname" name="user_name" /> <p>
</p> <label for="Lastname">LastName:</label>
<p> <input type="text" id="Lastname" name="user_name" />
<label for="surname">FirstName:</label> </p>
<input type="text" id="Firstname" name="user_name" /> <p>
</p> <label for="surname">FirstName:</label>
<p> <input type="text" id="Firstname" name="user_name" />
<label for="mail">Email:</label> </p>
<input type="email" id="mail" name="user_email" /> <p>
</p> <label for="mail">Email:</label>
<p> <input type="email" id="mail" name="user_email" />
<label for="sub">Subject:</label> </p>
<textarea id="sub" name="user_sub"></textarea> <p>
</p> <label for="sub">Subject:</label>
<p> <textarea id="sub" name="user_sub"></textarea>
<label for="path">Path:</label> </p>
<textarea id="path" name="user_path"></textarea> <p>
</p> <label for="path">Path:</label>
<p class="button"> <textarea id="path" name="user_path"></textarea>
<button type="submit">Send your message</button> </p>
</p> </form>
</form> </section>
<script> </body>
</html>
fetch("http://192.168.80.31:8080/p10.10/php/post.php", {
method: "POST",
headers: {
"Content-Type": "application/json" // Bezpośrednie przekazanie nagłówka
},
body: JSON.stringify({
"ln": "Kowalski",
"fn": "Jan",
"email": "jan.kowalski@example.com",
"subject": "Test subject",
"path": "/path/to/photo.jpg"
})
})
.then(response => {
return response.json(); // Oczekujemy odpowiedzi w formacie JSON
})
.then(data => {
console.log("Response from server:", data); // Wyświetlenie odpowiedzi z serwera
})
.catch(error => {
console.error("There was a problem with the fetch operation:", error);
});
</script>
</body>
</html>

10
php/__
View File

@ -1,10 +0,0 @@
curl -X POST http://192.168.80.31:8080/p10.10/php/post.php \
-H "Content-Type: application/json" \
-d '{
"ln": "Kowalski",
"fn": "Jan",
"email": "jan.kowalski@example.com",
"subject": "Test subject",
"path": "/path/to/photo.jpg"
}'

View File

@ -1,13 +0,0 @@
<?php
$con = mysqli_connect("192.168.80.31", "root", "secret", "db");
$data = json_decode(file_get_contents('php://input'), true);
$kw = "INSERT INTO Persons (LastName, FirstName, Email, Subject, Path) VALUES ('{$data['ln']}', '{$data['fn']}', '{$data['email']}', '{$data['subject']}', '{$data['path']}')";
$ans = mysqli_query($con, $kw);
echo json_encode($kw);
?>

View File

@ -1,10 +0,0 @@
curl -X POST http://192.168.80.31:8080/p10.10/php/post.php \
-H "Content-Type: application/json" \
-d '{
"ln": "Kowalski",
"fn": "Jan",
"email": "jan.kowalski@example.com",
"subject": "Test subject",
"path": "/path/to/photo.jpg"
}'

View File

@ -1,2 +0,0 @@
Invoke-RestMethod -Uri "http://192.168.80.31:8080/p10.10/php/post.php" -Method Post -ContentType "application/json" -Body '{"ln": "Kowalski", "fn": "Jan", "email": "jan.kowalski@example.com", "subject": "Test subject", "path": "/path/to/photo.jpg"}'

Binary file not shown.

View File

@ -1,14 +0,0 @@
CREATE TABLE Persons (
PersonID int primary key auto_increment,
LastName varchar(255),
FirstName varchar(255),
Email varchar(255),
Subject varchar(255),
Path varchar(255)
);
INSERT INTO Persons (LastName, FirstName, Email, Subject, Path)
VALUES
('Smith', 'John', 'john.smith@example.com', 'Math', '/path/to/johnsmith'),
('Doe', 'Jane', 'jane.doe@example.com', 'Physics', '/path/to/janedoe'),
('Brown', 'Charlie', 'charlie.brown@example.com', 'Chemistry', '/path/to/charliebrown');

View File

@ -1,14 +0,0 @@
CREATE TABLE Persons (
PersonID int primary key auto_increment,
LastName varchar(255),
FirstName varchar(255),
Email varchar(255),
Subject varchar(255),
Path varchar(255)
);
INSERT INTO Persons (LastName, FirstName, Email, Subject, Path)
VALUES
('Smith', 'John', 'john.smith@example.com', 'Math', '/path/to/johnsmith'),
('Doe', 'Jane', 'jane.doe@example.com', 'Physics', '/path/to/janedoe'),
('Brown', 'Charlie', 'charlie.brown@example.com', 'Chemistry', '/path/to/charliebrown');

1
token.txt Normal file
View File

@ -0,0 +1 @@
5ba1dd28707f6f4f2fdf11af8cf208f813dd4059