ok !
l´index.php
< ?php require_once(´Connections/conn_blog.php´); ? >
< ?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = " ", $theNotDefinedValue = " ")
{
$theValue = ( !get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ( $theType) {
case " text":
$theValue = ( $theValue ! = " ") ? " ´" . $theValue . " ´" : " NULL";
break;
case " long":
case " int":
$theValue = ( $theValue ! = " ") ? intval($theValue) : " NULL";
break;
case " double":
$theValue = ( $theValue ! = " ") ? " ´" . doubleval($theValue) . " ´" : " NULL";
break;
case " date":
$theValue = ( $theValue ! = " ") ? " ´" . $theValue . " ´" : " NULL";
break;
case " defined":
$theValue = ( $theValue ! = " ") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $HTTP_SERVER_VARS[´PHP_SELF´];
if ( isset($HTTP_SERVER_VARS[´QUERY_STRING´])) {
$editFormAction . = " ?" . $HTTP_SERVER_VARS[´QUERY_STRING´];
}
if ( (isset($HTTP_POST_VARS["MM_insert"])) && ( $HTTP_POST_VARS["MM_insert"] == " form1")) {
$insertSQL = sprintf("INSERT INTO blog ( name, text) VALUES ( %s, %s)",
GetSQLValueString($HTTP_POST_VARS[´name´], " text"),
GetSQLValueString($HTTP_POST_VARS[´text´], " text"));
mysql_select_db($database_conn_blog, $conn_blog);
$Result1 = mysql_query($insertSQL, $conn_blog) or die(mysql_error());
}
? >
< html>
< head>
< title>..:: ][ GraphiColas ][ ::..</title>
< meta content="photoshop, Photoshop, 7, photoshop 7, graphisme, graphic, infos, kits, kits graphiques, kit graphique, webdesign, webdesigns, designs, design, histoire, portfolio, creations, colas, malaise, colas malaise, graphicolas, GC, GraphiColas, Graphicolas, tutoriaux, tutos, tutorials, tutorial, tutoriel, tutoriels, news, comments, php, html, integration, decoupage, kits graphiques gratuits, bobcolas, BobColas, Bobcolas, liens, links, link, lien, images, image">
< meta name="keywords" content="photoshop, Photoshop, 7, photoshop 7, graphisme, graphic, infos, kits, kits graphiques, kit graphique,
webdesign, webdesigns, designs, design, histoire, portfolio, creations, colas, malaise, colas malaise, graphicolas, GC, GraphiColas,
Graphicolas, tutoriaux, tutos, tutorials, tutorial, tutoriel, tutoriels, news, comments, php, html, integration, decoupage, kits graphiques gratuits,
bobcolas, BobColas, Bobcolas, liens, links, link, lien, images, image">
< meta name="description" content="GraphiColas ( GC), tutoriaux pour Photoshop 7, CrÈations, Webdesigns et kits graphiques ? tÈlÈcharger gratuitement
histoire de Photoshop, tutoriaux sur le dÈcoupage de design ( intÈgration) en HTML; etc...">
< style type="text/css">
body {
text-decoration: none;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link {
text-decoration: none;
color: #333333;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:hover {
text-decoration: underline;
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:visited {
text-decoration: none;
color: #333333;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
< /style>
< /head>
< body>
< table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
< tr>
< td colspan="5"><img src="images/design_fleur_01.jpg" width="700" height="208"></td>
< /tr>
< tr>
< td colspan="5"><img src="images/design_fleur_02.jpg" width="70" height="38"><a href="portfolio/index.php"><img src="images/design_fleur_03.jpg" alt="Mon Portfolio" width="86" height="38" border="0"></a><img src="images/design_fleur_04.jpg" width="39" height="38"><a href="tutoriaux/index.php"><img src="images/design_fleur_05.jpg" alt="Les Tutoriaux" width="100" height="38" border="0"></a><a href="webdesign/index.php"><img src="images/design_fleur_06.jpg" alt="Webdesigns & Kits Graphiques" width="142" height="38" border="0"></a><a href="infos/index.php"><img src="images/design_fleur_07.jpg" alt="Mes Infos ( Contact)" width="85" height="38" border="0"></a><a href="toshop/index.php"><img src="images/design_fleur_08.jpg" alt="L´Histoire de Photoshop, les trucs et astuces... [ UnDeR cOnStRuCtIoN ]" width="96" height="38" border="0"></a><img src="images/design_fleur_09.jpg" width="82" height="38"></td>
< /tr>
< tr>
< td colspan="5"><img src="images/design_fleur_10.jpg" width="700" height="43"></td>
< /tr>
< tr>
< td width="28" height="184"><img src="images/design_fleur_11.jpg" width="28" height="184"></td>
< td width="368" valign="top"><iframe src="frames/frame_news.php" width="364" height="180" scrolling="auto" frameborder="0" align="middle" name="news"></iframe></td>
< td width="56"> < img src="images/design_fleur_13.jpg" width="33" height="184"><img src="images/design_fleur_14.jpg" width="23" height="184"></td>
< td width="200" valign="top"></td>
< td width="48"><img src="images/design_fleur_16.jpg" width="48" height="184"></td>
< /tr>
< tr>
< td colspan="5"><a href="frames/archives.php" target="news"><img src="images/design_fleur_17.jpg" width="396" height="60" border="0"></a><img src="images/design_fleur_180.jpg" width="304" height="60"></td>
< /tr>
< tr>
< td colspan="5"><img src="images/design_fleur_18.jpg" width="700" height="22"></td>
< /tr>
< tr>
< td colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0">
< tr>
< td width="28"><img src="images/design_fleur_19.jpg" width="28" height="188"></td>
< td width="325" valign="top"><iframe src="frames/frame_link.php" width="320" height="183" scrolling="no" align="middle" frameborder="0"></iframe></td>
< td width="55"><img src="images/design_fleur_22.jpg" width="55" height="188"></td>
< td width="236" valign="top"><iframe src="frames/frame_thanks.php" width="231" height="181" align="middle" frameborder="0"></iframe></td>
< td width="56"><img src="images/design_fleur_24.jpg" width="56" height="188"></td>
< /tr>
< /table></td>
< /tr>
< tr>
< td valign="top" colspan="5"><img src="images/design_fleur_25.jpg" width="700" height="84"></td>
< /tr>
< tr>
< td valign="top" colspan="5"><table width="700" border="0" cellspacing="0" cellpadding="0">
< tr>
< td width="28"
background="images/design_fleur_26.jpg"> </td
< td width="626" valign="top"> < div align="right"></div>
< table width="624" height="100%" border="0" align="right" cellpadding="0" cellspacing="0">
< tr>
< td width="250" valign="top"><iframe src="frames/blog.php"></iframe></td>
< td width="374" valign="top"><form method="post" name="form1" action="<?php echo $editFormAction; ? >">
< table align="center">
< tr valign="baseline">
< td nowrap align="right"><font size="2">Nom/Pseudo:</font></td>
< td><font size="2">
< input type="text" name="name" value="" size="30">
< /font></td>
< /tr>
< tr valign="baseline">
< td nowrap align="right"><font size="2">Message :</font></td>
< td><font size="2">
< textarea name="text" cols="30" rows="4"></textarea>
< /font></td>
< /tr>
< tr valign="baseline">
< td nowrap align="right"> </td>
< td><font size="2">
< input type="submit" value="Hop ! ">
< /font></td>
< /tr>
< /table>
< font size="2">
< input type="hidden" name="MM_insert" value="form1">
< /font>
< /form>
< p> </p></td>
< /tr>
< /table>
< /td>
< td width="48" valign="top" background="images/design_fleur_200.jpg"><img src="images/design_fleur_28.jpg" width="48" height="143"></td>
< /tr>
< /table></td>
< /tr>
< tr>
< td valign="top" colspan="5"><img src="images/design_fleur_29.jpg" width="700" height="29"></td>
< /tr>
< /table>
< /body>
< /html>
la page frames/blog.php
< ?php require_once(´../Connections/conn_blog.php´); ? >
< ?php
mysql_select_db($database_conn_blog, $conn_blog);
$query_rsBlog = " SELECT * FROM blog ORDER BY blogID DESC";
$rsBlog = mysql_query($query_rsBlog, $conn_blog) or die(mysql_error());
$row_rsBlog = mysql_fetch_assoc($rsBlog);
$totalRows_rsBlog = mysql_num_rows($rsBlog);
? >
< html>
< head>
< style type="text/css">
body {
text-decoration: none;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:link {
text-decoration: none;
color: #333333;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:hover {
text-decoration: underline;
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
a:visited {
text-decoration: none;
color: #333333;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
< /style>
< /head>
< body>
< ?php do { ? >
< table width="100%" border="0" cellspacing="0" cellpadding="0">
< tr>
< td><p><font size="2">De < strong><?php echo $row_rsBlog[´name´]; ? ></strong> >> < ?php echo $row_rsBlog[´text´]; ? ></font></p>
< p><font size="2"><br>
< /font></p>
< /td>
< /tr>
< /table>
< ?php } while ( $row_rsBlog = mysql_fetch_assoc($rsBlog)); ? >
< /body>
< /html>
< ?php
mysql_free_result($rsBlog);
? >
C´est trop compliqué...
J´y comprend rien...
Avant 4.1.0 > A partir de 4.1.0
$HTTP_GET_VARS > $_GET
$HTTP_POST_VARS > $_POST
$HTTP_POST_FILES > $_FILES
$HTTP_COOKIE_VARS > $_COOKIE
$HTTP_SESSION_VARS > $_SESSION
$HTTP_ENV_VARS > $_ENV
$HTTP_SERVER_VARS > $_SERVER
Super, non ?
Ensuite, pour ton do..while: l´intermrétateur fait le DO avant le WHILE dasn ça en va pas. Il faut faire un simple WHILE.
Pour un simple livre d´or, ton script c´est un beau merdier... J´y ai d´ailleur rien compris.
Tiens voici le script qui gère MON livre d´or:
http://perso.wanadoo.fr/pierre.z/ldo.txt
Hey Blawk . .. je me fait chier à comprendre pourquoi t´as écrit ça:
if ( !$start)
$start = 0;
( et je demande ça parceque j´arrive pas à voir ce que ça fait réellement)
Si ´var´ n´est pas précisé dans l´URL, $start est undefined et ça fait des couilles.
ah je vois ce que tu veux dire . .. ![]()
marrant les smileys
![]()
![]()
Ca me saoule le PHP !
je vais etudier ton truc Blawk, merci
@+
en fait j´ai tout fait avec DW, j´ai rien codé ![]()
Blawk, ds PhpMyAdmin, c´est quoi le nom de ta base de données et tu peux m´envoyer les fichiers avec les codes de tes tables stp ? ou alors dis les moi.
colasmalaise@wanadoo.fr
C´est quoi ton adresse msn ?
merci bcp ; )
P.S.: Je omprend un peu ce que tu as fait... ![]()
Oups, sorry...
CREATE TABLE ldo (
id int(11) NOT NULL auto_increment,
name varchar(50) default NULL,
mail varchar(60) default NULL,
body text NOT NULL,
date date NOT NULL default ´0000-00-00´,
PRIMARY KEY ( id)
) TYPE=MyISAM;
Je te conseille de changer el type de ´date´ pour TIMESTAMP(16). C´est mieux si tu as plussieurs messages pas jour.
Voici une date au format TIMESTAMP(14)
20030712152334
AAAAMMJJHHMMSS
A: Année
M: Mois
J: Jour
H: heure
M: Minute
S: seconde
Et par exemple, tu veux faire un enregistrement avec une date en TIMESTAMP(14), et bien tu fais comme ça:
INSERT INTO ta_table ( date) VALUES ( NOW())
Pratique, non ?
PS: Tu as pris un script tout fait ? T´a pas honte ? ![]()
ok merci, je l´appelle comment ma db ?
et c´est quoi les $req et $ans ?
merci
@+
Le nom de la base est dans la requète, c´est ´ldo´ ( pour Livre D´Or)
Dans mes script, $req est une chaine de caractère reprèsentant une requète MySQL et $ans est el résultat de mysql_query(). C´est une ( bonne) habitude que j´ai pris quand je fesais les tutos de phpdebutant.
Ok, c´est ce que j´ai fait...
Mais ca marche pas, je ne comprend pas ce que tu as mis dans les actions du formulaire, . index....... c´est la concatenation ?
merci
@+
Ah oui... J´avais oublié ça...
$index, c´est le nom de la page mère. Si par exemple je veux afficher mon site sur un autre design, la page en pourra pas s´appeler index.php elle aussi. Donc avant un script, je mets dans $index le nom de la page gabarit.
Ok, donc je dois inclure ce script dans la page index.php ? l´inclure ou insérer le code ? ( c´est pareil de toute facon!)
merci encore
Au tout début du script, il faut que tu mette
$index = ´la_page_du_livre_d_or.php´;
Ah ok, je comprend mieux ! ; ) merci