var countDownDate = new Date("Jan 5, 2021 15:37:25").getTime(); #include <iostream>
#include <string>
#include <fstream>
using namespace std;
string findLineInFile(ifstream &file, const string &substring){
int curLine = 0;
string line;
while(getline(file, line)) {
curLine++;
if (line.find(substring, 0) != string::npos) {
return line;
}
}
return "";
}
int main(int argc, char *argv[]){
string substring = "Студент";
ifstream file("Dictionary.txt");
if (file.is_open())
{
cout << findLineInFile(file, substring) << endl;
} else {
cout << "Невозможно открыть файл!";
}
file.close();
return 0;
} document.addEventListener('keydown', function(e){
KEY = ["t", "e", "s", "t"];
this.INPUT = this.INPUT || [];
this.INPUT.push(e.key);
if (this.INPUT.some((e, i) => KEY[i] != e))
this.INPUT = [this.INPUT.pop()];
else if (this.INPUT.length == KEY.length){
console.log("Congratulations!");
this.INPUT = [];
}
}) function getNumb(string) {
let arr = [];
for (let i of [...new Set(string)]){
arr[i] = string.split(i).length - 1;
}
return arr;
}
getNumb('aaabbrbbabdb'); // output: [a: 4, b: 6, r: 1, d: 1] $email = 'example@mail.com';
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo("Email некорректен");
} else {
echo("Email корректный");
}$answer = shell_exec("./ffmeg -param1 -param2");<form target="_blank" method="POST" action="../index.php">
<input type="radio" name="paymentType" value="PC">
<input type="radio" name="paymentType" value="AC">
<input type="radio" name="paymentType" value="MC">
</form>if (isset($_POST['paymentType'])){
if ($_POST['paymentType'] === 'PC')
header('Location: ../page/sds/3')
// ...
}это все понятно но мне нужно изменить форму до её отправки!!!
Тоесть в зависимости от выбранного radio форма будет уходить на другой сайт
<html>
<head>
<title>Document</title>
</head>
<body>
<form target="_blank" method="POST" action="../index.php" name="form">
<input type="radio" name="paymentType" value="PC">
<input type="radio" name="paymentType" value="AC">
<input type="radio" name="paymentType" value="MC">
</form>
<script type="text/javascript">
document.form.onchange = () => {
switch ((new FormData(document.form)).get('paymentType')){
case 'PC':
document.form.action = '/page/sds/3';
break;
case 'AC':
document.form.action = '/page/sds/4';
break;
case 'MC':
document.form.action = '/page/sds/5';
break;
}
}
</script>
</body>
</html>
let str= "https://example.com/some-string";
if (str.includes("some-string"))
console.log('Есть совпадение')let str= "https://example.com/some-string";
if (str.match(/some-string/))
console.log('Есть совпадение')<html>
<head>
<title>Document</title>
</head>
<body>
<form action="b.html" method="GET">
<input type="text" name="variable1">
<input type="text" name="variable2">
<input type="submit">
</form>
</body>
</html><html>
<head>
<title>Document</title>
</head>
<body>
<script type="text/javascript">
function getGETParameters(paramStr){
return Object.fromEntries(paramStr.split('&').map(e => decodeURI(e).split('=')));
}
console.log(getGETParameters(window.location.search.substr(1)));
</script>
</body>
</html><html>
<head>
<title>Document</title>
</head>
<body>
<script type="text/javascript">
function getGETParameters(paramStr){
return Object.fromEntries(paramStr.split('&').map(e => decodeURI(e).split('=')));
}
let variables = getGETParameters(window.location.search.substr(1));
console.log(variables["variable1"]); // эта строка выведет в консоль то, что Вы вводили в первый input
</script>
</body>
</html>