1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
| <?
//ouverture et control de la session
session_start();
if ( !session_is_registered("email") )
{
print "<center><b>Cette page et uniquement pour les membres<br> <br><a href='../index.php'>connection</a> <br>-||||-<br> <a href='inscription.php'>inscription</a></b><center>";exit;
}
//connexion a la base de donnée
include"config.php";
include"include/variable.php";
$db = mysql_connect($serveur, $login, $password);
mysql_select_db($base,$db);
//je recherche les données de la base membre de l'email du mec
if ($action == "change")
{
$query = "UPDATE $table SET pseudo = '$pseudo',email= '$email', passe= '$passe' ,nom= '$nom' ,prenom= '$prenom' ,pays= '$pays' , site ='$site', age ='$age', sexe='$sexe',departement ='$departement', ville='$ville', mot='$mot' WHERE email = '$email'";
$result = mysql_query($query);
}
if ($action == "image")
{
//ici je recherche l'image qui correspond a l'email
$query = "UPDATE $table SET image='$image' WHERE email = '$email'";
$result = mysql_query($query);}
$sql=("select image from $table Where email='$email'");$result=mysql_query($sql);
$rs=mysql_fetch_array($result);
$image=$rs["image"];
//ici je recherche l'id de l'email
$sql=("select id from $table Where email='$email'");
$result=mysql_query($sql);
$rs=mysql_fetch_array($result);
$id=$rs["id"];
//la requete je prends toutes les données de la table membre
$sql = "select*from $table WHERE email='$email'";
// on envoie la requete
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
echo"$info";
php $requete = mysql_query("Select * FROM a_galerie WHERE `auteur`='".$_SESSION['pseudo']."'");
// on ferme la connexion à mysql
mysql_close();
mysql_close($db);
?>
<html><head>
<link rel="stylesheet" type="text/css" href="style-gal.css">
<TITLE><? echo(":: Galerie d'images de .$pseudo. ::"); ?></TITLE>
</head><body>
<!-- DEBUT DU SCRIPT -->
<script language="JavaScript1.2">
function ejs_nodroit()
{
alert('Désolé, le clic droit a été désactivé sur cette page. ');
return(false);
}
document.oncontextmenu = ejs_nodroit;
</script>
<!-- FIN DU SCRIPT -->
<body background="im/fond1.jpg">
<SCRIPT LANGUAGE="JavaScript">
table_photo = new Array;
table_noms = new Array;
table_type = new Array;
<?
$a = 0;
$handle = opendir("up");
while (($file = readdir())!=false) {
clearstatcache();
$extension = strrchr($file, ".");
if($file!=".." && $file!="." && ($extension==".jpg" || $extension==".jpeg" || $extension==".gif" || $extension==".png" || $extension==".bmp"))
{
// RECHERCHE DU FICHIER
while ($result=mysql_fetch_array($requete))
{
echo "<img src=\"$result['urlphoto']\">;
}
// RECHERCHE DU TYPE DE FICHIER
$file_type = strrchr($file, ".");
$file_type = str_replace(".", "", $file_type);
$file_type = strtoupper($file_type);
echo "table_type[$a] = '$file_type';";
// RECHERCHE DU NOM :
$file_name = strtolower($file);
$file_name = str_replace(".jpg", "", $file_name);
$file_name = str_replace(".jpeg", "", $file_name);
$file_name = str_replace(".gif", "", $file_name);
$file_name = str_replace(".png", "", $file_name);
echo "table_noms[$a] = '$file_name';";
$a++;
}
}
closedir($handle);
?>
function showing_photos(num)
{
if(document.getElementById)
{
diaporama_fin = "";
if(num!=0)
diaporama_fin += "<td height=20><p align=center><A HREF=# onClick='showing_photos("+(num-1)+");return(false)'><img border=0 src=im/suiv.gif></A></td>";
if(num!=(table_photo.length-1))
diaporama_fin += "<td height=20><p align=center><A HREF=# onClick='showing_photos("+(num+1)+");return(false)'><img border=0 src=im/prec.gif></A></td>";
document.getElementById("affichage_photos").innerHTML = "<div align=center><center><table border=0 width=640 cellspacing=0 cellpadding=5 height=500><tr><td colspan=2 valign=middle width=100% bgcolor=#000000 height=20><table border=0 width=100% cellspacing=0 cellpadding=0><tr><td width=50%><img align=absmiddle border=0 src=im/nom-gal.gif width=16 height=16> Nom de l'image : "+table_noms[num]+"</td><td width=50%><img align=absmiddle border=0 src=im/typ-gal.gif width=16 height=16> Type d'image : "+table_type[num]+"</td></tr></table></td></tr><tr><td width=100% colspan=2 valign=middle height=380><table border=0 width=100% cellspacing=1 cellpadding=0 bgcolor=#FF0000 height=100%><tr><td width=100% bgcolor=#000000 height=380><center><img src='"+table_photo[num]+"' BORDER=0></center></td></tr></table></td></tr><br><br><tr>"+diaporama_fin+"</tr></table></center></div>";
}
}
window.onload = new Function("showing_photos(0)")
</SCRIPT>
<DIV align="center" ID="affichage_photos"></DIV>
<a href = "index.php">Retourner au service d'upload ?<a/>
</body>
</html> |
Partager