Voila j'ai un script qui me permet d'afficher le pseudo d'un utilisateur quand il est connecté mais je sais pas coder pour que lorsque la personne n'est pas logger à la place d'un vide (ou de sont pseudo si celle-ci est connecté) il y est le mot visiteur.
Voici mon code :
Code : Tout sélectionner
<?php
session_start(); //On ouvre la session pour pouvoir verifier si le membre est connecté
require "sessions/conf.php3"; //Commme d'ab
mysql_connect("$sql_serveur","$sql_login","$sql_pass");
mysql_select_db("$sql_bdd"); //Comme d'ab
$pseudo_membre = $_SESSION['pseudo'];
$requete = mysql_query("SELECT * FROM pdf_membre WHERE `pseudo`='$pseudo_membre'");
$sql = mysql_fetch_array ($requete);
$id = $sql['id'];
$pseudo = $sql['pseudo'];
/* On peut recuperer plus d'info si besoin */
?>
<html>
<head>
<title>Bienvenue sur tutophoto site de tutoriaux photoshop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type=text/css> body { background-attachment: fixed; background-repeat: no-repeat; background-position: top center;}</style>
</head>
<body bgcolor="#FFFFFF" background="images/background.JPG" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table width="800" border="0" cellspacing="0" cellpadding="0" align="center" height="133">
<tr valign="top">
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/top_bar_left.GIF" width="213" height="70"></td>
<td><img src="images/top_bar_middle.GIF" width="19" height="70"></td>
<td><img src="images/top_bar_right.GIF" width="569" height="70" border="0" usemap="#Map"></td>
<td><img src="images/point_line.GIF" width="1" height="70"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="21%" valign="top">
<table width="168" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/left_bar_hight.GIF" width="168" height="19"></td>
</tr>
<tr>
<td>
<table width="150" border="0" cellspacing="0" cellpadding="0" background="images/left_bar.GIF">
<tr valign="top">
<td height="581"> <img src="images/little_left_bar.GIF" width="150" height="18">
<p align="center">Bonjour <? echo "$pseudo"; ?></p>
<p align="center"><a href="sessions/pdf_connexion.php">Connectez
vous ici</a></p>
<div align="center"><a href="sessions/pdf_inscription.php">inscrivez
vous ici</a> </div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="79%" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="98%" valign="top"> </td>
<td width="2%">
<div align="right"><img src="images/point_line.GIF" width="1" height="600"></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/down_bar.GIF" width="801" height="36"></td>
<td><img src="images/point_line.GIF" width="1" height="35"></td>
</tr>
</table>
</td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="1,18,176,35" href="index.php">
<area shape="rect" coords="1,36,176,52" href="contact.php">
<area shape="rect" coords="178,18,353,35" href="tutoriaux.php">
<area shape="rect" coords="178,36,353,52" href="http://tutophoto.graphbb.com/">
<area shape="rect" coords="355,18,567,35" href="avatars_msn.php">
<area shape="rect" coords="355,36,567,52" href="mailto:tutophoto[ANTISPAMENLEVERLESCROCHETS]@free.fr">
</map>
</body>
</html>
