Ha oui éffectivement c'est loin, d'ètre simple.
Voici les sources qui me pause problèmes.
Peut-ètre que tu pourra m'expliqué comment procédé pour l intrégration de mon design avec mes scripts, sans utilisé le système de Template.
Voici mon design
<?php
//...
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dreamweaver, Flash, Photoshop, Illustrator,PHP/MYSQL <<Tutoriel en vidéo en ligne>> Cours, Forum, Tchat</title>
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" type="text/css" href="1.CSS" />
</head>
<div id="tout">
<h1 id="titre"> </h1>
<div id="nav">
<a href="index.php">Accueil</a>|<a href="#">Cours</a>|
<a href="inscription.php">Inscription</a>|
<a href="http://forum.ism-infomaster.com/index.php" target="_blank">Forum</a>|
<a href="#">Contacts</a>|
<form id="form1" name="form1" method="post" action="login.php?do=login">
<label>
Login
<input name="nomUtilisateur" type="text" id="nomUtilisateur" size="10" />
</label>
<label>Pass
<input name="motDePasse" type="password" id="motDePasse" size="10" />
</label><input name="log" type="submit" id="log" value="ok" /><p><label></label></p>
</form>
</div>
<div id="menugauche">
<ul>
<li><a href="#">Accueil</a></li>
<li><a href="#">Cours </a></li>
<li><a href="inscription.php">Inscription</a></li>
<li><a href="http://forum.ism-infomaster.com/index.php" target="_blank">Forum</a></li>
<li><a href="#">Contacts</a></li>
</ul>
</div>
<div id="contenu">
<div>
<p align="center"><strong>Accueil</strong></p>
<p align="left">Bienvenue sur le site PHPVisual, ce site sera consacreer au php et a tous ses dérivés le
concernant de loin ou de près.Pour vous aider il y aura un <a href="http://css.ism-infomaster.com/forum/index.php">forum</a>
vous pourrez poster pour demander des tutoriaux vidéos ou de l'aide si vous avez un problème. J'ai mit a votre disposition
quelque tuto en vidéo de démonstration donc n'hésitez à me contacter sur mon
MSN : <a href="#">[email protected]</a></p>
</div>
<p> </p>
</div>
<div id="footer">
©2006 ism-infomaster.com </div>
</div>
</div>
</body>
</html>
mon css
Code : Tout sélectionner
/* CSS Document */
body {
background-image: url(images/php.jpg);
}
#tout{
position: absolute;
top: 0;
left: 50%;
width:860px;
margin-left: -450px;
border:2px solid #000000;
background-color:#FFFCAC;
padding:1em;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
#titre, #footer, #nav {
text-align: center;
}
#nav {
background-color:#FFCC66;
padding:0.2em;
border: 1px solid #000;
font-size: 14px;
}
#contenu {
text-align: left;
height:auto;
margin-left: 150px;
}
#nav a{
padding: 0.2em;
font-weight: bold;
text-decoration: none;
color: #000000;
}
#nav a:hover{
color:#FFCC33;
background-color:#FF6600;
}
h1 {
font-size: 24px;
font-style: italic;
font-weight: bold;
}
#titre{
border-style:solid;
border-width:1px;
border-color:#000000;
height: 100px;
background-repeat: no-repeat;
background-image: url(images/baniere.gif);
background-position: center;
}
#form1, #form1 p {
display: inline;
}
/* menu de gauche */
#menugauche {
position: absolute;
width: 130px;
margin-top:1em;
}
#menugauche ul
{
margin: 0;
padding-left: 0;
list-style-type: none;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
}
#menugauche a
{
display: block;
padding: 2px;
width: auto;
background-color: #FFCC66;
border: 1px solid #000;
margin-bottom:2px;
color: #000000;
}
#menugauche a:link, #navlist a:visited
{
color: #F0066CC;
text-decoration: none;
}
#menugauche a:hover
{
background-color: #FF6600;
color: #FFCC33;
}
#footer
{
font-size:14px;
border: 1px solid #000;
background-color: #FFCC66;
}
et voici le page login.php là il ya toute les instructions
<?php
/*Programme : login.php
*Description : Programme de login pour la section à accès réservé du site
* Il propose deux options :
* 1 - s'identifier par un couple nom de login/motde passe
* 2 - creer un nouveau compte
*/
@session_start();
include("connection.php");
switch (@$_GET['do'])
{ case "login":
$connection = mysql_connect($host, $user, $password)
or die ("Connection impossible au serveur");
$db = mysql_select_db($database, $connection)
or die ("La base de donnée ne peut être sélectionnée");
$sql = "SELECT nomLogin FROM membre
WHERE nomLogin='$_POST[nomUtilisateur]'";
$result =mysql_query($sql)
or die (mysql_error());
$num = mysql_num_rows($result);
if ($num ==1) //le nom du login à été trouvé
{$sql = "SELECT nomLogin FROM membre
WHERE nomLogin='$_POST[nomUtilisateur]'
AND mPasse=password('$_POST[motDePasse]')";
$result2 =mysql_query($sql)
or die (mysql_error());
$num2 = mysql_num_rows($result2);
if ($num2 >0) // mot de passe correcte
{$_SESSION['auth']="yes";
$logname = $_POST['nomUtilisateur'];
$_SESSION ['logname'] = $logname;
$aujourdhui = date("Y-m-d h:i:s");
$sql = "INSERT INTO login (nomLogin, dateLogin)
VALUES ('$logname','$aujourdhui')";
mysql_query($sql)
or die (mysql_error());
/*Attention à l'usage de la function header()
if (!headers_sent()) {
header ("Location: PageMembre.php");
exit;
}*/
include("NouveauMembre.php");
exit();
}
else // mot de passe incorrect
{ unset ($do);
$message="Le nom de login'$_POST[nomUtilisateur]'
existe déja, mais votre mot de passe n est pas correct.<br>";
include("login_form.php");
}
}
elseif ($num ==0) // nom de login absent
{ unset ($do);
$message="Le login n'existe pas.<br>";
include("login_form.php");
}
break;
case"new" :
foreach($_POST as $clé => $valeur)
{
if ($clé !="fax")
{
if ($valeur =="")
{
unset($_GET['do']);
$message_new = "Il manque des informations obligatoires. Corrigez, svp!";
include("login_form.php");
exit();
}
}
if (ereg("(nom)",$clé))
{
if (!ereg("^[A-Za-z' éèêàâîïôûùü-]{1,50}$",
stripslashes($valeur)))
{
unset($_GET['do']);
$message_new = "$clé n'est pas un nom valide";
include("login_form.php");
exit();
}
}
$$clé = strip_tags(trim($valeur));
}
if (! ereg("[0-9]{5}",$_POST['codePostal'])
or strlen($_POST['codePostal'])!=5)
{
unset($_GET['do']);
$message_new = "Le code postal n'est pas correcte";
include("login_form.php");
exit();
}
if (! ereg("^[0-9 - .]{10,14}",$_POST['phone']))
{
unset($_GET['do']);
$message_new = "Le numéro de téléphone n'est pas valide";
include("login_form.php");
exit();
}
if ($_POST['fax'] !="")
{
if (! ereg("^[0-9 - .]{10,14}",$_POST['fax']))
{
unset($_GET['do']);
$message_new = "Le numéro de fax n'est pas valide";
include("login_form.php");
exit();
}
}
if (! ereg("^.+@.+\\..+$",$_POST['email']))
{
unset($_GET['do']);
$message_new = "Votre email n'est pas valide";
include("login_form.php");
exit();
}
// Le nom de login existe-t-il déja?
$connection = mysql_connect($host, $user, $password)
or die ("Connection impossible au serveur");
$db = mysql_select_db($database, $connection)
or die ("La base de donnée ne peut être sélectionnée");
$sql = "SELECT nomLogin FROM membre
WHERE nomLogin='$_POST[nomMembre]'";
$result =mysql_query($sql)
or die (mysql_error());
$num = mysql_num_rows($result);
if($num >0)
{
unset($_GET['do']);
$message_new = "Ce nom est déja utilisé. Choisissez un autre identificateur";
include("login_form.php");
exit();
}
else
{ $aujourdhui = date("Y-m-d");
$département = substr($_POST['codePostal'], 0, 2);//Pour la france
$sql ="INSERT INTO membre (nomLogin,création,mPasse,
prénom,nom,rue,ville,département,codePostal,
téléphone,fax,email)
VALUES ('$_POST[nomMembre]','$aujourdhui',password('$_POST[newpass]'),
'$_POST[prénom]','$_POST[nom]','$_POST[rue]','$_POST[ville]','$département',
'$_POST[codePostal]','$_POST[phone]','$_POST[fax]','$_POST[email]')";
if (! mysql_query($sql))
{ echo mysql_errno().":".mysql_errno();
exit;
}
$nomUtilisateur = $_POST['nomMembre'];
$_SESSION['auth']="yes";
$_SESSION['logname']= $nomUtilisateur;
/*Envoyer un email au nouveau membre*/
$message = "Un nouveau compte de membre vient d'ètre créé pour vous.".
"Votre identificateur et votre mot de passe sont: ".
"\n\n\t$nomUtilisateur\n\t$_POST[newpass]\n\n";
//préparation de l envoye de mail avec un header
$entete = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$sujet ="Votre nouveau compte";
$adresse = $_POST['email'];
$mailsend = mail("$adresse","$sujet","$message","$entete");
/*Attention à l'usage de la function header()
if (!headers_sent()) {
header ("Location: NouveauMembres.php");
exit;*/
include("NouveauMembre.php");
exit();}
break;
default: include("login_form.php");
}
?>
et pour la mise en forme de mon formulaire d'inscription
<body>
<form id="form1" name="form1" method="post" action="login.php?do=login">
<label>
<?php
if (isset($message))
echo "<tr><td colspan='2' >$message</td></tr>";?>
Login
<input name="nomUtilisateur" type="text" id="nomUtilisateur" />
</label>
<label>Pass
<input name="motDePasse" type="password" id="motDePasse" />
</label><input name="log" type="submit" id="log" value="identifiez vous" />
</form>
<br />
<form id="form2" name="form2" method="post" action="login.php?do=new">
<label></label>
<?php
if (isset($message_new))
echo "<tr><td colspan='2' ><b>$message_new</b></td></tr>";?><br>
<label>Nom de membre
<input name="nomMembre" type="text" id="nomMembre" value="<?php echo @$_POST['nomMembre']?>" maxlength="20" />
</label><br />
<label>Mot de passe
<input name="newpass" type="password" id="newpass" value="<?php echo @$_POST['newpass']?>" maxlength="20" />
</label><br />
<label>Prenom
<input name="prénom" type="text" id="prénom" value="<?php echo @$_POST['prénom']?>" />
</label><br />
<label>Nom
<input name="nom" type="text" id="nom" value="<?php echo @$_POST['nom']?>" />
</label><br />
<label>Rue
<input name="rue" type="text" id="rue" value="<?php echo @$_POST['rue']?>" />
</label><br />
<label>Ville
<input name="ville" type="text" id="ville" value="<?php echo @$_POST['ville']?>" />
</label><br />
<label>Code postal
<input name="codePostal" type="text" id="codePostal" value="<?php echo @$_POST['codePostal']?>" />
</label><br />
<label>Téléphone
<input name="phone" type="text" id="phone" value="<?php echo @$_POST['phone']?>" />
</label><br />
<label>Fax
<input name="fax" type="text" id="fax" value="<?php echo @$_POST['fax']?>" />
</label><br />
<label>email
<input name="email" type="text"t" id="email" value="<?php echo @$_POST['email']?>" />
</label><br />
<label>
<input type="submit" name="Submit" value="Enregistrez vous" />
</label>
</form>
<p> </p>
</body>
J'aimerai si possible intrégré mon design à ces 2 scripts.