servnest/public/ns/txt.php

36 lines
762 B
PHP
Raw Normal View History

<?php require "../../common/html.php"; ?>
2021-02-24 18:39:42 +01:00
<form method="post">
<?php require "../../form.ns.php"; ?>
2022-04-18 16:05:00 +02:00
<br>
<label for="txt">Texte</label>
<br>
<input id="txt" minlenght="5" maxlength="8192" pattern="^[a-zA-Z0-9 =:!%$+/\()[\]_-]{5,8192}$" placeholder="Du texte..." name="txt" type="text">
<br>
<input value="Valider" type="submit">
2021-02-24 18:39:42 +01:00
</form>
<?php
2021-05-16 16:55:39 +02:00
if (nsCommonRequirements()
2022-04-18 16:05:00 +02:00
AND isset($_POST['txt'])
) {
2021-02-24 18:39:42 +01:00
2022-04-18 16:05:00 +02:00
$values = nsParseCommonRequirements();
2021-02-24 18:39:42 +01:00
2022-04-18 16:05:00 +02:00
if (!(preg_match("/^[a-zA-Z0-9 =:!%$+\/\()[\]_-]{5,8192}$/", $_POST['txt'])))
userError("Wrong value for <code>txt</code>.");
2021-02-24 18:39:42 +01:00
2022-05-25 01:16:41 +02:00
knotcExec($_POST['zone'], array(
$values['domain'],
$values['ttl'],
"TXT",
"\"" . $_POST['txt'] . "\""
));
2022-04-18 16:05:00 +02:00
echo "Enregistrement ajouté";
2021-02-24 18:39:42 +01:00
}
?>
<?php closeHTML(); ?>