Dans le dernier message la syntaxe données n'est pas la bonne donc je balance la totale
En programmation php et html
un fichier emetteur envoivar.php un fichier recepteur historibac.php qui contient une image à créer un clic sur l'image renvoie la réponse
à un internaute inconnu mais client pour convenir de l'exploitation des variables.
le fichier envoivar.php contient la technique des feuilles de style pouvant mettre en forme les imput
ci-dessous envoivar.php
<?php
if (!isset($_GET["reponse"])){
$reponse="";
}else{
$reponse=$_GET["reponse"];
}
?>
<html>
<head>
<title>envoyer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
input#t1 {
background-color : #B9B9FF;
color : #CC0000;
}
input {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: 13px;
font-weight: bold;
font-variant: small-caps;
text-transform: lowercase;
color: #CC0000;
}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center"></div>
<div align="center">
<table width="716" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFCC99">
<!--DWLayoutTable-->
<tr>
<td width="102" height="37"></td>
<td width="114"></td>
<td width="9"></td>
<td width="112"></td>
<td width="107"></td>
<td width="39"></td>
<td width="178"> </td>
<td width="55"></td>
</tr>
<tr>
<td height="15"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td rowspan="3" align="center" valign="middle">Si t'as pas tapé tasse<br>
je le saurais</td>
<td></td>
</tr>
<form name="form1" method="post" action="historibac.php">
<tr>
<td height="22"></td>
<td align="right" valign="middle" bgcolor="#CCCCCC"><font color="#CC0000" face="Verdana, Arial, Helvetica, sans-serif"><strong>tapez
tasse </strong></font></td>
<td colspan="3" valign="middle"> <strong>
<!--il est possible d'effacer dans le style CSS LES LIGNES 2, 3, 4, 5 (retrait du background) mais je les laisse car
c'est deux techniques distinctes pour arriver au même resultat le style est rattaché à l'input grace
à id="t1" avec ce principe seul l'input t1 sera affecté du style
le deuxiéme style input affecte tous les inputs de la page input du bas n'a pas de background-->
<input name="question" id="t1" type="text" value="<?php echo $reponse; ?>">
</strong></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="14"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="15"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="24"></td>
<td></td>
<td> </td>
<td align="center" valign="middle"> <input type="submit" name="roulodeprintemp" value="Envoyer">
</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="66"></td>
<td></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</form>
</table>
</div>
</body>
</html>
******************************fin envoivar.php*************************************
fichier historibac.php
<?php
if (!isset($_POST["question"])){
$question="";
}else{
$question=$_POST["question"];
}
//echo "<br>je suis question posée_____ :".$question."<br>";
//l'url du client est inconnue mais plus maintenant grace à bibi
echo "<br>hélas la réponse se colle en extrémité a chaque clic___ : ".$_SERVER["HTTP_REFERER"];
//obligé de nettoyer l'extrémité de l'url en retirant la partie réponse qui se colle apres lepoint d'inerrogation
$urlretour=$_SERVER["HTTP_REFERER"];
$trouve = "?";
//explode eclate en deux chaînes de caractéres à gauche et à droite du ?
$urlprov=explode($trouve,$urlretour);
echo "<br>moi variable tableau la partie gauche de l'explode _____ : ".$urlprov[0];
//prendre que la partie avant le ?
$urlretourdef=$urlprov[0];
echo "<br>moi variable, pas tableau urlretourdef dont on a retiré la réponse collée en bout____ : ".$urlretourdef;
if ($question<>"tasse"){
$reponse="t'as pas tapé tasse ?";
}else{
$reponse="c'est ta meuf";
}
?>
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="507" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="30" height="24"> </td>
<td width="52"> </td>
<td width="142"> </td>
<td width="72"> </td>
<td width="131"> </td>
<td width="52"> </td>
<td width="28"> </td>
</tr>
<tr>
<td height="20"> </td>
<td> </td>
<td rowspan="2" valign="top">
<!--<a href="envoivar.php?reponse=a thé"><img src="images/som.jpg" width="141" height="110" border="0"></a>-->
<a href="<?php echo $urlretourdef.'?reponse='.$reponse; ?>"><img src="images/som.jpg" width="141" height="110" border="0"></a>
</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="109"> </td>
<td> </td>
<td> </td>
<td colspan="2" valign="top"><p align="center"><strong>Cliquer sur l'image</strong></p>
<p align="justify"> pour renvoyer une réponse a l'internaute client
mais dont l'url était inconnu.</p></td>
<td> </td>
</tr>
<tr>
<td height="55"> </td>
<td> </td>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="38"> </td>
<td colspan="4" align="center" valign="top">Pour que cela fonctionne il faut
que la page de l'internaute et la notre soient capables exploiter la variable
reponse et question</td>
<td> </td>
<td></td>
</tr>
<tr>
<td height="19"> </td>
<td> </td>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="25"></td>
<td colspan="4" align="center" valign="top">un petit coût de style sur
l'input ça dérange pas trop ???</td>
<td></td>
<td></td>
</tr>
<tr>
<td height="15"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
******************fin historibac.php*****************************