A voir également:
- Mini moteur de recherche
- Meilleur mini pc - Accueil - Guide ordinateurs
- Opera mini pc - Télécharger - Navigateurs
- Recherche automatique des chaînes ne fonctionne pas - Guide
- Google moteur de recherche page d'accueil - Guide
- Geekom mini it11 - Accueil - Guide ordinateurs
2 réponses
el plaga
Messages postés
89
Date d'inscription
jeudi 11 septembre 2008
Statut
Membre
Dernière intervention
14 janvier 2010
4
18 févr. 2009 à 18:55
18 févr. 2009 à 18:55
voila un petit code que pour la recherche des ordi par exemple
Pour faire simple:
code de l'index:
<?php
include("Templates/includes/header.php");
?>
code header.php
<?php
?>
<html>
<head>
<script language='Javascript'>
//au chargement de la page, on appelle la fonction montre()
window.onload=montre;
//affichage du menu déroulant et placement de ce dernier
function montre(id,affiche)
{
var d = document.getElementById(id);
//si on quitte un élément du menu
if (d && !affiche)
{
d.style.display='none'; //on l'efface
var c=d.parentNode; //son parent
if (c.parentNode.parentNode.parentNode.tagName!='DIV') //si c'est un sous-menu, on rend à son parent les couleurs d'origine
{
c.firstChild.style.color='#39f';
c.firstChild.style.background='#fff';
}
}
//sinon si on se mets sur un élément du menu
else if (d && affiche)
{
d.style.display='block'; //on l'affiche
var c=d.parentNode; //son parent
if (c.parentNode.parentNode.parentNode.tagName!='DIV') //si c'est un sous-menu, on donne à son parent les couleurs de survol
{
c.firstChild.style.color='#fff';
c.firstChild.style.background='#39f';
}
}
}
</script>
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/body.css" />
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/pied.css" />
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/menu.css" />
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/header.css" />
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/header.css" />
</head>
<body>
<DIV class=page>
<DIV class=conteneur>
<DIV class=head>
<DIV class=titre>
<A href="http://www.computer.cm"><IMG title="" alt="" src="Templates/images/logo.gif"/></A></BR>
<SPAN class=font_titre>La reference au Cameroun</SPAN>
</DIV>
<DIV class=head_search>
<DIV class=head_search2>
<FORM id=head_search action="vente.php" method="post">
<!--Mttre le code java ici-->
<TABLE style="FLOAT: right" cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD>Chercher <INPUT class=small style="WIDTH: 100px" size=18 value="....Recherche" name="Mot_cles" />
Dans <SELECT class=small size=1 name="in_search" >
<OPTION value=1>HP</OPTION>
<OPTION value=2>DELL</OPTION>
<OPTION value=3>Produits Imation</OPTION>
<OPTION value=4>Produits Compact</OPTION>
<OPTION value=5>Produits Linux</OPTION>
<OPTION value=6 selected>Produits Windows</OPTION>
<OPTION value="copieur_canon">Copieur Canon</OPTION>
<OPTION value="imprimante_hp">imprimante HP</OPTION>
<OPTION value="ordi_complet">Ordi complet</OPTION>
<OPTION value="">Cours</OPTION></SELECT>
</TD>
<TD><INPUT title="Chercher dans la base de Wise Computers"
style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN-LEFT: 4px; BORDER-LEFT: 0px; WIDTH: 19px; BORDER-BOTTOM: 0px; HEIGHT: 14px"
type=image src="Templates/images/btn_ok.png">
</TD>
<TD>
<IMG style="cursor:pointer" title="Recherche avancée" style="MARGIN-LEFT: 3px; WIDTH: 9px; HEIGHT: 14px" src="Templates/images/search_plus.png">
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</DIV>
</DIV>
</DIV>
<div class="footer1">
<a href="index.php" class=liens_footer> Accueil</a> | Top 10|
<a href="apres_vente.php" class=liens_footer>service apres-vente</a>|
<a href="#" class=liens_footer> service de vente</a>|
<a href="#" class=liens_footer>Guide d'achat</a>|
<a href="#" class=liens_footer>Nos Services</a>|
<a href="#" class=liens_footer>Achat professionnel</a>|
<a href="#" class=liens_footer>Promos</a>|
<a href="nos_mag.php" class=liens_footer>Nos magasins</a>|
<a href="#" class=liens_footer> Ventes Flash</a>
</div>
<?php
?>
code vente page qui gere la recherche
<?php
include("Templates/includes/header.php");
//menu
include("Templates/includes/config.php");
function purcent($a,$b)
{
$c=(($a/$b)*100);
return round($c,2);
}
mysql_connect("$server","$user","$pwd");
mysql_select_db("$db");
$keys_wrd=$_POST['Mot_cles'];
$in_search=$_POST['in_search'];
switch ($in_search)
{
case 'copieur_canon':
$requete=mysql_query("SELECT * FROM copieur_canon WHERE serial_num LIKE \"%$keys_wrd%\" ") or die(mysql_error());
$resultat=mysql_num_rows($requete);
if ($resultat==0)
{
?>
vous n'avez pas le droit d'etre sur ce site va te faire mettre
<?php
}else{ echo '<div id="corps">';
while($rtc=mysql_fetch_array($requete))
{
?>
<div class="miniboxproduit" style="padding-right:10px; margin-right:10px;">
<h1><a href="https://www.pixmania.com/"><?php echo $rtc['serial_num']?></a> <span class="nbcategorie">(5912)</span></h1>
<div class="navcontainer" style="float: left;">
<ul>
<li class="first">
<a class="segment" href=""><?php echo $rtc['serial_num']?><span class="nbmarche">(334)</span></a></li>
<li>
<a class="segment" href=""><?php echo $rtc['serial_num']?> <span class="nbmarche">(242)</span></a></li>
<li>
<a class="segment" href="">DS <span class="nbmarche">(549)</span></a></li>
</ul>
</div>
<div style="float: left; width: 210px; height: 120px;">
<div style="float: left; height: 120px;">
<div style="margin: 0pt; padding: 0pt; float: left;">
<div style="width: 100px;"><a href=""><img src="<?php echo $rtc['lien_image']?>" alt="Poker" border="0"></a></div>
</div>
<div style="margin: 0px; padding: 0pt 0pt 0pt 5px; overflow: hidden; float: left; width: 95px;">
<del class="prd-old-amount"><?php echo $rtc['old_price']?></del>
<p class="prix" style="font-size: 18px;"><?php echo $rtc['new_price']?></p>
<p class="prd-sticker small"><?php echo purcent($rtc['new_price'],$rtc['old_price']); ?>%</p>
<p class="stock"><?php echo $rtc['details']?></p>
</div>
</div>
</div>
</div>
<?php
}
echo "</div>";
}
break;
case 'ordi_complet':
$requete=mysql_query("SELECT * FROM ordi_complet WHERE ktqs LIKE \"%$keys_wrd%\" ") or die(mysql_error());
$resultat=mysql_num_rows($requete);
function extra($a)
{
list($b,$c,$d,$e,$f,$g)=explode("/",$a);
return array($b,$c,$d,$e,$f,$g);
}
if ($resultat==0)
{
?>
vous n'avez pas le droit d'etre sur ce site va te faire mettre
<?php
}else{ echo '<div id="corps">';
while($rtc=mysql_fetch_array($requete))
{
?>
<div class="miniboxproduit" style="padding-right:4px; margin-right:10px;">
<h1><a href=""><?php echo $rtc['serial_num']?></a> <span class="nbcategorie">(5912)</span></h1>
<div class="navcontainer" style="float: left;">
<ul>
<li class="first">
<?php echo $rtc['marque']?><span class="nbmarche">(334)</span></li>
<?php
list($b,$c,$d,$e,$f,$g)=extra($rtc['ktqs']);
?>
<li><?php echo $b?></li>
<li><?php echo $c?> </li>
<li><?php echo $d?> </li>
<li><?php echo $e?> </li>
<li><?php echo $f?> </li>
<li><?php echo $g?> </li>
<?php
?>
</ul>
</div>
<div style="float: left; width: 200px; height: 100px;">
<div style="float: left; height: 120px;">
<div style="margin: 0pt; padding: 0pt; float: left;">
<div style="width:10px;"><img src="<?php echo $rtc['lien_image']?>" alt="" border="0"></div>
</div>
<div style="margin: 0px; padding: 0pt 0pt 0pt 5px; overflow: hidden; float: left; width: 95px;">
<del class="prd-old-amount"><?php echo $rtc['old_price']?></del>
<p class="prix" style="font-size: 18px;"><?php echo $rtc['new_price']?></p>
<p class="prd-sticker small"><?php echo purcent($rtc['new_price'],$rtc['old_price']); ?>%</p>
<p class="stock"><?php echo $rtc['details']?></p>
</div>
</div>
</div>
</div>
<?php
}
echo '</div>';
}
break;
default:
echo"votre chemin d'acces est mal specifier";
}
include("Templates/includes/menu.php");
//pied
include("Templates/includes/pied.php");
?>
code config.php
<?php
$server="localhost";
$pwd="";
$user="root";
$db="computer";
?>
Si t'a des pb send moi un sms et je vais d'aider :-)
Pour faire simple:
code de l'index:
<?php
include("Templates/includes/header.php");
?>
code header.php
<?php
?>
<html>
<head>
<script language='Javascript'>
//au chargement de la page, on appelle la fonction montre()
window.onload=montre;
//affichage du menu déroulant et placement de ce dernier
function montre(id,affiche)
{
var d = document.getElementById(id);
//si on quitte un élément du menu
if (d && !affiche)
{
d.style.display='none'; //on l'efface
var c=d.parentNode; //son parent
if (c.parentNode.parentNode.parentNode.tagName!='DIV') //si c'est un sous-menu, on rend à son parent les couleurs d'origine
{
c.firstChild.style.color='#39f';
c.firstChild.style.background='#fff';
}
}
//sinon si on se mets sur un élément du menu
else if (d && affiche)
{
d.style.display='block'; //on l'affiche
var c=d.parentNode; //son parent
if (c.parentNode.parentNode.parentNode.tagName!='DIV') //si c'est un sous-menu, on donne à son parent les couleurs de survol
{
c.firstChild.style.color='#fff';
c.firstChild.style.background='#39f';
}
}
}
</script>
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/body.css" />
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/pied.css" />
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/menu.css" />
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/header.css" />
<link rel="stylesheet" media="screen" type="text/css" title="body" href="Templates/css/header.css" />
</head>
<body>
<DIV class=page>
<DIV class=conteneur>
<DIV class=head>
<DIV class=titre>
<A href="http://www.computer.cm"><IMG title="" alt="" src="Templates/images/logo.gif"/></A></BR>
<SPAN class=font_titre>La reference au Cameroun</SPAN>
</DIV>
<DIV class=head_search>
<DIV class=head_search2>
<FORM id=head_search action="vente.php" method="post">
<!--Mttre le code java ici-->
<TABLE style="FLOAT: right" cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD>Chercher <INPUT class=small style="WIDTH: 100px" size=18 value="....Recherche" name="Mot_cles" />
Dans <SELECT class=small size=1 name="in_search" >
<OPTION value=1>HP</OPTION>
<OPTION value=2>DELL</OPTION>
<OPTION value=3>Produits Imation</OPTION>
<OPTION value=4>Produits Compact</OPTION>
<OPTION value=5>Produits Linux</OPTION>
<OPTION value=6 selected>Produits Windows</OPTION>
<OPTION value="copieur_canon">Copieur Canon</OPTION>
<OPTION value="imprimante_hp">imprimante HP</OPTION>
<OPTION value="ordi_complet">Ordi complet</OPTION>
<OPTION value="">Cours</OPTION></SELECT>
</TD>
<TD><INPUT title="Chercher dans la base de Wise Computers"
style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN-LEFT: 4px; BORDER-LEFT: 0px; WIDTH: 19px; BORDER-BOTTOM: 0px; HEIGHT: 14px"
type=image src="Templates/images/btn_ok.png">
</TD>
<TD>
<IMG style="cursor:pointer" title="Recherche avancée" style="MARGIN-LEFT: 3px; WIDTH: 9px; HEIGHT: 14px" src="Templates/images/search_plus.png">
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</DIV>
</DIV>
</DIV>
<div class="footer1">
<a href="index.php" class=liens_footer> Accueil</a> | Top 10|
<a href="apres_vente.php" class=liens_footer>service apres-vente</a>|
<a href="#" class=liens_footer> service de vente</a>|
<a href="#" class=liens_footer>Guide d'achat</a>|
<a href="#" class=liens_footer>Nos Services</a>|
<a href="#" class=liens_footer>Achat professionnel</a>|
<a href="#" class=liens_footer>Promos</a>|
<a href="nos_mag.php" class=liens_footer>Nos magasins</a>|
<a href="#" class=liens_footer> Ventes Flash</a>
</div>
<?php
?>
code vente page qui gere la recherche
<?php
include("Templates/includes/header.php");
//menu
include("Templates/includes/config.php");
function purcent($a,$b)
{
$c=(($a/$b)*100);
return round($c,2);
}
mysql_connect("$server","$user","$pwd");
mysql_select_db("$db");
$keys_wrd=$_POST['Mot_cles'];
$in_search=$_POST['in_search'];
switch ($in_search)
{
case 'copieur_canon':
$requete=mysql_query("SELECT * FROM copieur_canon WHERE serial_num LIKE \"%$keys_wrd%\" ") or die(mysql_error());
$resultat=mysql_num_rows($requete);
if ($resultat==0)
{
?>
vous n'avez pas le droit d'etre sur ce site va te faire mettre
<?php
}else{ echo '<div id="corps">';
while($rtc=mysql_fetch_array($requete))
{
?>
<div class="miniboxproduit" style="padding-right:10px; margin-right:10px;">
<h1><a href="https://www.pixmania.com/"><?php echo $rtc['serial_num']?></a> <span class="nbcategorie">(5912)</span></h1>
<div class="navcontainer" style="float: left;">
<ul>
<li class="first">
<a class="segment" href=""><?php echo $rtc['serial_num']?><span class="nbmarche">(334)</span></a></li>
<li>
<a class="segment" href=""><?php echo $rtc['serial_num']?> <span class="nbmarche">(242)</span></a></li>
<li>
<a class="segment" href="">DS <span class="nbmarche">(549)</span></a></li>
</ul>
</div>
<div style="float: left; width: 210px; height: 120px;">
<div style="float: left; height: 120px;">
<div style="margin: 0pt; padding: 0pt; float: left;">
<div style="width: 100px;"><a href=""><img src="<?php echo $rtc['lien_image']?>" alt="Poker" border="0"></a></div>
</div>
<div style="margin: 0px; padding: 0pt 0pt 0pt 5px; overflow: hidden; float: left; width: 95px;">
<del class="prd-old-amount"><?php echo $rtc['old_price']?></del>
<p class="prix" style="font-size: 18px;"><?php echo $rtc['new_price']?></p>
<p class="prd-sticker small"><?php echo purcent($rtc['new_price'],$rtc['old_price']); ?>%</p>
<p class="stock"><?php echo $rtc['details']?></p>
</div>
</div>
</div>
</div>
<?php
}
echo "</div>";
}
break;
case 'ordi_complet':
$requete=mysql_query("SELECT * FROM ordi_complet WHERE ktqs LIKE \"%$keys_wrd%\" ") or die(mysql_error());
$resultat=mysql_num_rows($requete);
function extra($a)
{
list($b,$c,$d,$e,$f,$g)=explode("/",$a);
return array($b,$c,$d,$e,$f,$g);
}
if ($resultat==0)
{
?>
vous n'avez pas le droit d'etre sur ce site va te faire mettre
<?php
}else{ echo '<div id="corps">';
while($rtc=mysql_fetch_array($requete))
{
?>
<div class="miniboxproduit" style="padding-right:4px; margin-right:10px;">
<h1><a href=""><?php echo $rtc['serial_num']?></a> <span class="nbcategorie">(5912)</span></h1>
<div class="navcontainer" style="float: left;">
<ul>
<li class="first">
<?php echo $rtc['marque']?><span class="nbmarche">(334)</span></li>
<?php
list($b,$c,$d,$e,$f,$g)=extra($rtc['ktqs']);
?>
<li><?php echo $b?></li>
<li><?php echo $c?> </li>
<li><?php echo $d?> </li>
<li><?php echo $e?> </li>
<li><?php echo $f?> </li>
<li><?php echo $g?> </li>
<?php
?>
</ul>
</div>
<div style="float: left; width: 200px; height: 100px;">
<div style="float: left; height: 120px;">
<div style="margin: 0pt; padding: 0pt; float: left;">
<div style="width:10px;"><img src="<?php echo $rtc['lien_image']?>" alt="" border="0"></div>
</div>
<div style="margin: 0px; padding: 0pt 0pt 0pt 5px; overflow: hidden; float: left; width: 95px;">
<del class="prd-old-amount"><?php echo $rtc['old_price']?></del>
<p class="prix" style="font-size: 18px;"><?php echo $rtc['new_price']?></p>
<p class="prd-sticker small"><?php echo purcent($rtc['new_price'],$rtc['old_price']); ?>%</p>
<p class="stock"><?php echo $rtc['details']?></p>
</div>
</div>
</div>
</div>
<?php
}
echo '</div>';
}
break;
default:
echo"votre chemin d'acces est mal specifier";
}
include("Templates/includes/menu.php");
//pied
include("Templates/includes/pied.php");
?>
code config.php
<?php
$server="localhost";
$pwd="";
$user="root";
$db="computer";
?>
Si t'a des pb send moi un sms et je vais d'aider :-)