Citation du jour !!!

Francois_Pignon - 4 déc. 2001 à 21:22
 Mcjo - 6 déc. 2001 à 19:46
Dans l'exemple suivant, on explique comment gérer un affichage de citation de manière aléatoire...
Comment faire pour afficher une citation non pas de manière aléatoire mais 1 différente par jour !!!
est ce possible et si oui, comment
D'avance Merci

<%
Set objFile = Server.CreateObject("Scripting.FileSystemObject")
Set objStream = objFile.OpenTextFile(Server.MapPath("/citations") & "\citations.txt")

Randomize Timer
intCit = Int(Rnd * 5)
For i = 0 to intCit
objStream.SkipLine
Next

strCit = objStream.ReadLine

objStream.Close
Set objStream = Nothing
Set objFile = Nothing
%>

1 réponse

bon tu mets tes citation dans une base de donnée.
nom : citation
champ : id (numeroauto)
champ : citation (memo)

tu crees une 2eme table
nom : jour
champ : id_cit
champ : date

tu ouvre ta table jour
si [date] <> date() alors
[date] = date()
Randomize Timer
[id_cit] = Int(Rnd * (nombre de champ de citation))
fin si

tu ouvre sitation où id=[id_cit]
afficher ([sitation])

voila.
si tu veux je peut te faire l'asp .
envoye moi un mail
0
Rejoignez-nous