Bouton submit et plusieurs actions

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : Bouton submit et plusieurs actions

par skyangel » 22 mars 2006, 14:59

(Chuis pas sur qu'en tant qu'invité il puisse édité... si un modo peut passer pour nous enlever tout ce gras et mettre un peu de couleur :))
non je peux pas éditer.

oui c du dream.

Il faudait que je fasse du nettoyage , je le ferais apres :):)

il se passe qui'l modifie bien la table selon la requete que je passe. mais il prend pas en compte le code javascript. il ne ferme pas la fenetre ni reload la fenetre parente.

par ephemere » 22 mars 2006, 14:13

si si y peut même en temps qu'invité. :wink:
Ben moi j'trouve que c'est quand même bien pratique dreamweaver surtout quand on débute! Bon c'est sur c'est pas parfait et y faut régulièrement retourner dans le code faire le ménage et supprimer quelques balises qui trainent mais j'connait pas mieux :?

par Ryle » 22 mars 2006, 14:05

(Chuis pas sur qu'en tant qu'invité il puisse édité... si un modo peut passer pour nous enlever tout ce gras et mettre un peu de couleur :))

Qu'est ce qui ne marche pas exactement ? il ne se passe rien ? tu as des erreurs javascript ? (p'tit triangle jaune en bas à gauche sur IE ?) le code que tu donnes corresond bien à ta popup ? ...

Remarque subsidiaire : ça, c'est vraiment pas beau..
<tr %>
...
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=10 height=1></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=50 height=1></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=120 height=1></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>

serait-ce du dreamweaver ? :) (ça à l'air d'être la mode en ce moment de l'utiliser pour faire du php ;))

par ephemere » 22 mars 2006, 13:13

En faisant éditer et en entourant le php de deux balises php (bouton au dessus de ta fenêtre quand tu rédige) ça serait peut être un peu plus lisible...surtout pour un code aussi long :wink:

par skyangel » 22 mars 2006, 13:09

merci de votre réponse.
j ai testé mais cela ne fonctione pas apparemment .

je poste mon code.
<?php
include ('variable.php');
//on protege la page avce le script de securite
$cfgProgDir = 'phpSecurePages/';
include($cfgProgDir . "secure.php");
$auteur = $_GET['auteur'];
$id_get = $_GET['id'];
//$id = $ligne_intervention[0];
include ('connexion.php');
//on reprend les infos de la bdd pour la description
$query_get_auteur = "select * from ".$dbintervention." where ".$login_intervention_field." ='".$auteur."' and ".$id_intervention_field." ='".$id_get."'";
$get_auteur = mysql_query($query_get_auteur) or die(mysql_error());
$ligne_get_auteur=mysql_fetch_array($get_auteur,MYSQL_NUM);
//information desc
$query_info= "select ".$dbmachine.".".$nompc_machine_field.",".$dbmachine.".".$nomreseau_machine_field.",".$telephone_telephone_field." , ".$ipdouai_machine_field.", ".$iplille_machine_field." , ".$iplens_machine_field." , ".$mdp_collaborateur_field.",".$dbcollaborateur.".".$nom_collaborateur_field." ,".$site_collaborateur_field."
from ".$dbmachine." , ".$dbcollaborateur." , ".$dbtelephone."
where ".$dbcollaborateur.".".$login_collaborateur_field."='".$auteur." '
and ".$dbcollaborateur.".".$nompc_machine_field." = ".$dbmachine.".".$nompc_machine_field."
and ".$dbcollaborateur.".".$login_collaborateur_field." = ".$dbtelephone.".".$login_telephone_field."";

$array = mysql_query($query_info) or die(mysql_error());
$ligne_array=mysql_fetch_array($array,MYSQL_NUM);
// on teste les trois boutons

//si modifier

if (isset($_POST['modifier']))
{
//on initialise le message
$message="";
//on teste si des_admin est vide
if (empty($_POST['desadmin']))
{
$desadmin= false;
$message.=$mess_desc1_admindesc;
}
else
{
$desadmin=$_POST['desadmin'];
}
if ($desadmin)
{
$requete ="Update ".$dbintervention." set ".$desc_admin_intervention_field." ='".$desadmin."' where ".$login_intervention_field."='".$auteur."' and ".$id_intervention_field." = '".$id_get."'";
$query = mysql_query($requete) or die (mysql_error());
header ('location: '.$page_desc.$ext.'?id='.$id_get.'&auteur='.$auteur);

}
if ($message)
{
echo '<font color="red">'.$message.'</font>';
}

}
//si archiver
if (isset($_POST['archiver']))
{
$des_archive ="Update ".$dbintervention." set ".$archive_intervention_field." ='".$opt1."' where ".$login_intervention_field."='".$auteur."' and ".$id_intervention_field." = '".$id_get."'";
$des_query = mysql_query($des_archive) or die (mysql_error());
?><script>
document.parent.opener.location.reload(); // recharge la page parente de la popup
document.parent.opener.focus(); // on revient sur la page parente
self.close(); // on ferme la popup
</script><?php

}
//si resolu
if (isset($_POST['resolu']))
{
$des_resolu="Update ".$dbintervention." set ".$resolu_intervention_field." ='".$opt1."' , ".$date_resolu_intervention_field."='".$datedujour."' where ".$login_intervention_field."='".$auteur."' and ".$id_intervention_field." = '".$id_get."'";
$des_query = mysql_query($des_resolu) or die (mysql_error());
header ('location: '.$page_desc.$ext.'?id='.$id_get.'&auteur='.$auteur);
}
?>
<html>
<head>
<title>Description intervention</title>
<style>
p, li, div {font-size:8.00pt;font-family:"Verdana";}

TD.MenuOff {font-family : Verdana; font-size : 8pt; text-align : center; font-weight : bolder; background-color : #669900; color:#FFFFFF; cursor:hand;}
.clCMEvent{position:absolute; z-index:300; width:100%; height:100%; clip:rect(0,100%,100%,0); left:0; top:0; visibility:hidden}
.clCMAbs{position:absolute; width:0; height:10; left:0; top:0; visibility:hidden}
.clTest,.clT,.clTover,.clS,.clSover{padding:2px;font-family:arial; font-size:8pt; position:absolute; overflow:hidden; cursor:pointer; cursor:hand;}
.clT,.clTover{font-weight:bold;}
.clT,.clS,.clTover{color:#FFFFFF;}
.clSover{color:#666666;}
.clS{background-color:#666666 ; layer-background-color:#666666;}
.clSover{layer-background-color:#FFFFFF; background-color:#FFFFFF;}
.clB{position:absolute; left:0; top:0; visibility:hidden;layer-background-color:#FFFFFF; background-color:#FFFFFF;}

.B1{background-image: url(/%27img/charte/experts/filetht.gif%27);background-repeat:repeat-x;}
.B2{background-color:#FFFFFF;}
.B3{background-color:#FFFFFF;}
.B4{background-color:#FFC240;}
.B5{background-image: url(/%27img/charte/experts/filetbas.gif%27);background-repeat:repeat-x;}

.FD{background-color:#FFFFFF;}
.CadreMenu{background-color:#5F5F5F;}
.FondMenu{background-color:#FFFFFF;filter:alpha(opacity=75);}
.TitreMenu{font-family:arial black;font-size:10pt;color:#5F5F5F;font-weight:normal;}
A.Menu,.TxtMenu{font-family:verdana;font-size:8pt;color:#000000;text-decoration:none;}

TD,DIV,INPUT,SELECT,TEXTAREA,.textecentre{font-family:verdana;font-size:8pt;color:#000000;font-weight:normal;}
INPUT,SELECT,TEXTAREA{border-style:solid;border-color:#000000;border-width:1;}
INPUT.radio{border-width:0;}
INPUT.obli,SELECT.obli,TEXTAREA.obli{background-color:#DAE6FF;}
TEXTAREA{overflow:auto;}
A{text-decoration:underline;color:#000000;}
A:hover{text-decoration:none;}

.NomPortail{font-family:arial;font-size:14pt;color:#FFFFFF;font-weight:bold;}
.NomPortail2{font-family:arial;font-size:14pt;color:#5F5F5F;font-weight:bold;}
A.NomPortail{font-family:arial;font-size:14pt;color:#FFFFFF;font-weight:bold;text-decoration:none;}
A.NomPortail:hover{font-family:arial;font-size:14pt;color:#5F5F5F;font-weight:bold;text-decoration:none;}

TD.Search{font-family:verdana;font-size:9pt;color:#FFFFFF;font-weight:bold;}
INPUT.Search{color:#000000;border-color:#FFFFFF;background-color:#FFFFFF;}
INPUT.SearchButton{color:#FFFFFF;border-color:#5F5F5F;background-color:#5F5F5F;}

.TitreTab{font-family:verdana;font-size:8pt;color:#FFFFFF;font-weight:bold;}
.ColorTab{background-color:#5F5F5F;}

.Agenda{font-family:verdana;font-size:10pt;color:#FF9900;font-weight:bold;}
.DateAgenda{font-family:verdana;font-size:8pt;color:#FF9900;font-weight:bold;}
.TitreHome{font-family:verdana;font-size:14pt;color:#5F5F5F;font-weight:bold;}
.TexteHome{}
.SurLigne{font-family:verdana;font-size:8pt;color:#000000;background-color:#BCBCBC;font-weight:normal;}
.TypDocHome{font-family:verdana;font-size:10pt;color:#595959;font-weight:bold;}

.TitreArt{font-family:verdana;font-size:14pt;color:#A41128;font-weight:bold;}
.ResumeArt{font-family:verdana;font-size:8pt;color:#000000;font-weight:bold;}
.TitrePage{font-family:verdana;font-size:14pt;color:#595959;font-weight:bold;}

.Bas,A.Bas{font-family:arial;font-size:7pt;color:#000000;text-decoration:none;}
A.Bas:hover{color:#ACACAC;}
A.HautPage{text-decoration:none;color:#000000;}
A.HautPage:hover{text-decoration:none;color:#ACACAC;}

A.Art{text-decoration:none;color:#000000;}
A.Art:hover{text-decoration:none;color:#ACACAC;}

A.TitrePage{text-decoration:none;font-family:verdana;font-size:14pt;color:#595959;font-weight:bold;}
A.TitrePage:hover{text-decoration:none;font-family:verdana;font-size:14pt;color:#595959;font-weight:bold;}

A.TypDoc{text-decoration:none;color:#000000;}
A.TypDoc:hover{text-decoration:underline;color:#000000;}

A.Home{text-decoration:underline;color:#ACACAC;}
A.Home:hover{text-decoration:none;}
A.Homebis{text-decoration:none;color:#ACACAC;}
A.Homebis:hover{text-decoration:underline;color:#ACACAC;}

A.TitreTab{text-decoration:underline;FFFFFF}
A.TitreTab:hover{text-decoration:none;FFFFFF}

.p{font-family:Verdana;font-size:10pt;color: #868686;font-weight:bold;}

.EP {BORDER:1px solid #FFFFFF;EMPTY-CELLS:show;BORDER-COLLAPSE:collapse}
.EP TD {FONT-SIZE:10px;BORDER-TOP:1px solid #DDDDDD;HEIGHT:23px;PADDING-LEFT:2px;PADDING-RIGHT:4px}
</style>
<script language="JavaScript">
function impr() {
window.print();
}

function ferm() {
window.close();
window.opener.focus();
}
</script>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<form name="modifier" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>?auteur=<?php echo $auteur;?>&id=<?php echo $id_get?>">
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="90%">
<tr>
<td><img src="<?php echo $chemin_image;?>px.gif" height="16" width="1"></td>
</tr>
<tr>
<td valign="top" bgcolor="white">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
<table border=0 cellpadding=2 cellspacing=0 width=540 align="center">
<tr %>
<td>
<table border=0 cellpadding=0 cellspacing=0 width=182>
<tr>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=10 height=1></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=50 height=1></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=120 height=1></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td rowspan=3>&nbsp;<b>Fiche</b></td>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td colspan=3>
<table border=0 cellpadding=8 cellspacing=0>
<tr>
<td>
<table width="172" border=0 cellpadding=0 cellspacing=2>
<tr>
<td width="26">N°</td>
<td width="5">:</td>
<td width="120" nowrap><?php echo $ligne_get_auteur[0] ;?></td>
</tr>
<tr>
<td>Date</td>
<td>:</td>
<td nowrap><?php echo $ligne_get_auteur[5]."&nbsp;&nbsp;".$ligne_get_auteur[12];?></td>
</tr>
<tr>
<td>Résolu</td>
<td>:</td>
<td nowrap>
<?php if ($ligne_get_auteur[10] == $opt1) //si c resolu on affiche la date
{
echo $ligne_get_auteur[7];
}
else
{
echo $ligne_get_auteur[10] ;}?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=5 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
</table>
</td>
<td>
<table border=0 cellpadding=0 cellspacing=0 width=200>
<tr>
<td width="1"><img src="<?php echo $chemin_image;?>/px.gif" width=1 height=1></td>
<td width="10"><img src="<?php echo $chemin_image;?>px.gif" width=10 height=1></td>
<td width="100"><img src="<?php echo $chemin_image;?>px.gif" width=100 height=1></td>
<td width="238"><img src="<?php echo $chemin_image;?>px.gif" width=238 height=1></td>
<td width="1"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td rowspan=3>&nbsp;<b>Interlocuteur</b>&nbsp;</td>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td colspan=3>
<table border=0 cellpadding=8 cellspacing=0>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=2>
<tr>
<td>Nom</td>
<td>:</td>
<td nowrap><?php echo $ligne_array[7];?></td>
</tr>
<tr>
<td>Téléphone</td>
<td>:</td>
<td nowrap><b><?php echo $ligne_array[2] ;?></b></td>
</tr>
<tr>
<td>Site</td>
<td>:</td>
<td nowrap><?php echo $ligne_array[8] ;?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=5 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=2>
<table border=0 cellpadding=0 cellspacing=0 width="545">
<tr>
<td width="1"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td width="10"><img src="<?php echo $chemin_image;?>px.gif" width=10 height=1></td>
<td width="150"><img src="<?php echo $chemin_image;?>px.gif" width=150 height=1></td>
<td width="381"><img src="<?php echo $chemin_image;?>px.gif" width=374 height=1></td>
<td width="1"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td rowspan=3 nowrap>&nbsp;<b>Information diverses</b>&nbsp;</td>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td colspan=3>
<table border=0 cellpadding=8 cellspacing=0>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=2>
<tr>
<td>Catégorie</td>
<td>:</td>
<td nowrap><?php echo $ligne_get_auteur[3] ;?></td>
<td colspan="40"></td>
<td>IP Douai</td>
<td>:</td>
<td nowrap><?php if ($ligne_array[8] == $douai) { echo '<B><a href="http://'.$ligne_array[3].':5800" class="Menu" target="_blank">'.$ligne_array[3].'</a></b>';} else {echo '<a href="http://'.$ligne_array[3].':5800" class="Menu" target="_blank">'.$ligne_array[3].'</a>';}?></td>
</tr>
<tr>
<td>Nom machine</td>
<td>:</td>
<td nowrap><?php echo $ligne_array[0] ;?></td>
<td colspan="40"></td>
<td>IP Lille</td>
<td>:</td>
<td nowrap><?php if ($ligne_array[8] == $lille) { echo '<B><a href="http://'.$ligne_array[5].':5800" class="Menu" target="_blank">'.$ligne_array[5].'</a></b>';} else {echo '<a href="http://'.$ligne_array[5].':5800" class="Menu" target="_blank">'.$ligne_array[3].'</a>';}?></td>
</tr>
<tr>
<td>Nom réseau</td>
<td>:</td>
<td nowrap><?php echo $ligne_array[1] ;?></td>
<td colspan="40"></td>
<td>IP Lens</td>
<td>:</td>
<td nowrap><?php if ($ligne_array[8] == $lens) { echo '<B><a href="http://'.$ligne_array[4].':5800" class="Menu" target="_blank">'.$ligne_array[4].'</a></b>';} else {echo '<a href="http://'.$ligne_array[4].':5800" class="Menu" target="_blank">'.$ligne_array[3].'</a>';}?></td>
</tr>
<tr>
<td>Mot de passe</td>
<td>:</td>
<td nowrap><?php echo $ligne_array[6] ;?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=5 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=2>
<table border=0 cellpadding=0 cellspacing=0 width="545">
<tr>
<td width="1"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td width="10"><img src="<?php echo $chemin_image;?>px.gif" width=10 height=1></td>
<td width="115"><img src="<?php echo $chemin_image;?>px.gif" width=115 height=1></td>
<td width="416"><img src="<?php echo $chemin_image;?>px.gif" width=409 height=1></td>
<td width="1"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td rowspan=3 nowrap>&nbsp;<b>Descriptif </b></td>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td colspan=3>
<table border=0 cellpadding=8 cellspacing=0>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=2>
<tr>
<td><?php echo $ligne_get_auteur[4] ;?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=5 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=2>
<table border=0 cellpadding=0 cellspacing=0 width="545">
<tr>
<td width="1"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td width="10"><img src="<?php echo $chemin_image;?>px.gif" width=10 height=1></td>
<td width="185"><img src="<?php echo $chemin_image;?>px.gif" width=185 height=1></td>
<td width="346"><img src="<?php echo $chemin_image;?>px.gif" width=339 height=1></td>
<td width="1"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td rowspan=3 nowrap>&nbsp;<b>Descriptif Administrateur</b>&nbsp;</td>
<td colspan=2><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
<td rowspan=4 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
<tr>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
<td><img src="<?php echo $chemin_image;?>px.gif" width=1 height=6></td>
</tr>
<tr>
<td colspan=3>
<table border=0 cellpadding=8 cellspacing=0>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=2>
<tr>
<td><textarea cols="84" rows="5" name="desadmin"><?php echo $ligne_get_auteur[11];?></textarea></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=5 bgcolor="#C1CDD8"><img src="<?php echo $chemin_image;?>px.gif" width=1 height=1></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=2>&nbsp; </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table> <input type="submit" name="modifier" value="Modifier">&nbsp;
<input type ="submit" name="archiver" value="archivé" >&nbsp;
<input type="submit" name="resolu" value="résolu">&nbsp;

</td>
</tr>
</table>
</form>
<center>
<input type="button" name="print" value="Imprimer" onclick="print()">&nbsp;
<input type="button" name="fermer" value="fermer " onclick="ferm()">&nbsp;</center>

</body>
</html>

par Ryle » 22 mars 2006, 12:40

C'est d'avantage côté javascript que se trouve ton problème..

Si j'ai bien compris, ton bouton se trouve dans une popup et poste le formulaire dans cette même popup ?

Dans ce cas, il te suffit, lorsque le formulaire est posté et que ton champ est mis à jour dans la base, d'écrire un bout de code javascript dans la popup pour actualiser la page parente et fermer la popup. Quelque chose dans ce goût là :
<? 
if (isset($_POST['archiver'])) { 
  ... // update en base
  ?>
  <script>
    document.parent.opener.location.reload(); // recharge la page parente de la popup
    document.parent.opener.focus(); // on revient sur la page parente
    self.close(); // on ferme la popup
  </script>
<? } ?>

Bouton submit et plusieurs actions

par skyangel » 22 mars 2006, 11:19

BOnjour,

Voila j'ai un bouton submit qui met à jour un champ de table.
Je voudrais que lorsqu'on clik sur ce bouton , cela met à jour la table mais aussi qu'il ferme la popup par la suite, et encore qu'il rafraichit la page parent.

j'essaye deja de fermer ma page en mettant un window.close(). mais il ne le prend pas en compte du coup j'ai tout enleve.

voila le code correspondant.



//si archiver
if (isset($_POST['archiver']))
{
$des_archive ="Update ".$dbintervention." set ".$archive_intervention_field." ='".$opt1."' where ".$login_intervention_field."='".$auteur."' and ".$id_intervention_field." = '".$id_get."'";
$des_query = mysql_query($des_archive) or die (mysql_error());
//header ('location: '.$page_desc.$ext.'?id='.$id_get.'&auteur='.$auteur);

}


<input type ="submit" name="archiver" value="archivé">&nbsp;




Pouvez m'aider à faire les trois actions en appuyant sur le bouton.