Files
doc-fr/reference/fdf/examples.xml
2021-09-24 04:13:47 +01:00

69 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<chapter xml:id="fdf.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<para>
Les exemples suivants montrent comment évaluer les données
du formulaire.
<example>
<title>Évaluer un document FDF</title>
<programlisting role="php">
<![CDATA[
<?php
// Ouvrir un fichier FDF depuis une chaîne fournie par l'extension PDF
// Le formulaire PDF contient plusieurs champs texte avec les noms
// volume, date, comment, publisher, preparer et deux boîtes à cocher
// show_publisher et show_preparer.
$fdf = fdf_open_string($HTTP_FDF_DATA);
$volume = fdf_get_value($fdf, "volume");
echo 'Le champ Volume contient la valeur : "<strong>' . $volume . '</strong>"<br />';
$date = fdf_get_value($fdf, "date");
echo 'La valeur du champ date était "<strong>' . $date . '</strong>"<br />';
$comment = fdf_get_value($fdf, "comment");
echo 'La valeur du champ comment était "<strong>' . $comment . '</strong>"<br />';
if (fdf_get_value($fdf, "show_publisher") == "On") {
$publisher = fdf_get_value($fdf, "publisher");
echo "La valeur du champ Publisher était : '<strong>" . $publisher . "</strong><br />";
} else
echo 'La valeur du champ Publisher ne doit pas être affichée.<br />';
if (fdf_get_value($fdf, "show_preparer") == "On") {
$preparer = fdf_get_value($fdf, "preparer");
echo 'La valeur du champ Preparer était "<strong>' . $preparer . '</strong>"<br />';
} else
echo 'La valeur du champ Preparer ne doit pas être affiché.<br />';
fdf_close($fdf);
?>
]]>
</programlisting>
</example>
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->