t2 en cours
This commit is contained in:
29
TD/TD2/b.php
29
TD/TD2/b.php
@@ -1,18 +1,23 @@
|
||||
<?php
|
||||
$form = $_POST;
|
||||
|
||||
require('./config.php');
|
||||
|
||||
|
||||
if(isset($_POST['Nom'])) {
|
||||
if( isset($_POST["Pays"]) && $_POST["Pays"] != '' &&
|
||||
isset($_POST["Département"]) && $_POST["Département"] != '' &&
|
||||
isset($_POST["Ville"]) && $_POST["Ville"] != '' &&
|
||||
isset($_POST["Organisation"]) && $_POST["Organisation"] != '' &&
|
||||
isset($_POST["Unite"]) && $_POST["Unite"] != '' &&
|
||||
isset($_POST["Nom"]) && $_POST["Nom"] != '' &&
|
||||
isset($_POST["Prenom"]) && $_POST["Prenom"] != '' &&
|
||||
isset($_POST["Email"]) && $_POST["Email"] != '' ) {
|
||||
$dn = array(
|
||||
"countryName" => "FR",
|
||||
"stateOrProvinceName" => "Alpes Maritimes",
|
||||
"localityName" => "Nice",
|
||||
"organizationName" => "iut",
|
||||
"organizationalUnitName" => "iotia",
|
||||
"commonName" => "Pauline Srifi",
|
||||
"emailAddress" => "pauline@srifi.fr"
|
||||
"countryName" => $_POST["Pays"],
|
||||
"stateOrProvinceName" => $_POST["Département"],
|
||||
"localityName" => $_POST["Ville"],
|
||||
"organizationName" => $_POST["Organisation"],
|
||||
"organizationalUnitName" => $_POST["Unite"],
|
||||
"commonName" => '$_POST["Nom"]' . ' ' .'$_POST["Prenom"]',
|
||||
"emailAddress" => $_POST["Email"]
|
||||
);
|
||||
$pk = openssl_pkey_new($config);
|
||||
$req = openssl_csr_new($dn, $pk, $config);
|
||||
@@ -24,6 +29,8 @@ if(isset($_POST['Nom'])) {
|
||||
echo "Certificat exporté<br />";
|
||||
echo "Requête exportée<br />";
|
||||
echo "Clée privée exportée<br />";
|
||||
} else {
|
||||
echo '<h1 style="color:#ff0000">Merci de rentez toutes les valeurs demandeés et corectement SVP </h1>';
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +46,8 @@ if(isset($_POST['Nom'])) {
|
||||
<label for="Pays">Pays</label> <input type="text" name="Pays" id="Pays" value=""/><br />
|
||||
<label for="Organisation">Organisation</label> <input type="text" name="Organisation" id="Organisation" value=""/><br />
|
||||
<label for="Unite">Unite</label> <input type="text" name="Unite" id="Unite" value=""/><br />
|
||||
<label for="Email">Email</label> <input type="email" name="Email" id="Email" value=""/><br />
|
||||
|
||||
<input type="submit" name="Envoyer" value="Envoyer" />
|
||||
</form>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user