Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Cellophile
PersonaLink
Commits
e6a77210
Commit
e6a77210
authored
May 21, 2021
by
Cellophile
🎨
Browse files
Replace fonctions.php
parent
a5134eff
Changes
1
Hide whitespace changes
Inline
Side-by-side
fonctions.php
View file @
e6a77210
...
...
@@ -34,13 +34,13 @@ function uniciteurl($verif,$srcfichiercsv) {
}
}
function
creer
(
$upersok
,
$urlbase
,
$srcfichiercsv
){
function
creer
(
$
urlsite
,
$
upersok
,
$urlbase
,
$
mdp
,
$datexpi
,
$timexpi
,
$
srcfichiercsv
){
// Puis on enregistre cette url dans le doc csv:
if
(
$returnerror
==
0
){
$list
=
array
(
array
(
$upersok
,
$urlbase
)
array
(
$upersok
,
$urlbase
,
$datexpi
,
$timexpi
)
);
$fp
=
fopen
(
$srcfichiercsv
,
"ab"
);
foreach
(
$list
as
$field
){
...
...
@@ -62,16 +62,34 @@ function creer($upersok,$urlbase,$srcfichiercsv){
fclose
(
$lecture
);
// Ensuite on crée un fichier php pour établir la retirection :
$nfphp
=
__DIR__
.
'/d/'
.
$upersok
.
'.php'
;
$fichieredirect
=
fopen
(
$nfphp
,
"w"
);
fwrite
(
$fichieredirect
,
"<?php
header('Status: 301 Moved Permanently', false, 301);
header('Location: "
.
$urlbase
.
"');
exit();
?>"
);
fclose
(
$fichieredirect
);
if
(
$mdp
!==
false
)
{
$nfphp
=
__DIR__
.
'/d/'
.
$upersok
.
'.php'
;
$fichieredirect
=
fopen
(
$nfphp
,
"w"
);
$infoa
=
"$"
.
"lecturetest"
;
$infob
=
"$"
.
"mdpstock"
;
$infoc
=
"$"
.
"urlredirect"
;
fwrite
(
$fichieredirect
,
"<?php
if (!empty(
$infoa
)){
$infob
= '
$mdp
';
$infoc
= '
$urlbase
';
return;
}else{
header('Status: 301 Moved Permanently', false, 301);
header('Location: "
.
$urlsite
.
"password.php?redirect="
.
$upersok
.
"');
exit();
}
?>"
);
fclose
(
$fichieredirect
);
}
else
{
$nfphp
=
__DIR__
.
'/d/'
.
$upersok
.
'.php'
;
$fichieredirect
=
fopen
(
$nfphp
,
"w"
);
fwrite
(
$fichieredirect
,
"<?php
header('Status: 301 Moved Permanently', false, 301);
header('Location: "
.
$urlbase
.
"');
exit();
?>"
);
fclose
(
$fichieredirect
);
}
// on lit ce qu'on vient d'écrire :
$relecture
=
fopen
(
$nfphp
,
"r"
);
...
...
@@ -84,4 +102,14 @@ function creer($upersok,$urlbase,$srcfichiercsv){
return
$retour
;
}
}
function
fichiertemp
(
$fichiertemp
,
$upersoval
,
$ubaseval
,
$datexpi
,
$heurexpi
){
$list
=
array
(
array
(
$upersoval
,
$ubaseval
,
$datexpi
,
$heurexpi
));
$ftemp
=
fopen
(
$fichiertemp
,
"ab"
);
foreach
(
$list
as
$field
){
fputcsv
(
$ftemp
,
$field
);
}
fclose
(
$ftemp
);
}
?>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment