par
afi » 10 mars 2012, 20:56
Ma page1:
<?php
require ("Connect.php");
$connexion = mysql_pconnect (SERVEUR, NOM, PASSE);
mysql_select_db (BASE,$connexion);
$sql = mysql_query("SELECT * FROM emploi WHERE id='$_SESSION[id]'");
while($result=mysql_fetch_array($sql))
{
echo '<tr class=etiquette>
<td width=0 height=20><input type="texte" name="id_emploi" size="1" value="' .$result['id_emploi'].'"></td>
<td width=60 height=20>' .$result['date_debut'].'</td>
<td width=60 height=20>' .$result['date_fin'].'</td>
<td width=220 height=20>' .$result['poste'].'</td>
<td width=50 height=20>' .$result['type_contrat'].'</td>
<td width=300 height=20>' .$result['entreprise'].'</td>
<td class=supp width=0 height=20><a href=" memo_experiences.php?id='.$result['id_emploi'].'"
onclick="return(confirm(\'Etes-vous sûr de vouloir supprimer ces informations?\'));" >Supprimer</a></td>
<td class=supp width=0 height=20><a href="memo_experiences_modif.php?id ='.$result['id_emploi'].'">modifier</a></td>
</tr>';
}
?>
ma page2, après avoir cliqué sur lien modifié:
<?php
require ("Connect.php");
$connexion = mysql_pconnect (SERVEUR, NOM, PASSE);
mysql_select_db (BASE,$connexion);
$id = $_GET['id_emploi'];
$sql = mysql_query("SELECT * FROM emploi WHERE id='.$_GET[id_emploi].'");
$result = mysql_fetch_array($sql);
echo '<table width=750 border=0 align=center cellpadding=2 cellspacing=1 >
<tr class=memo3_etiquette>
<td width=60 height=20>id</td>
<td width=60 height=20>date_debut</td>
<td width=60 height=20>date_fin</td>
<td width=220 height=20>poste occupé</td>
<td width=50 height=20>contrat</td>
<td width=300 height=20>entreprise</td>
</tr>';
$result = mysql_fetch_array($sql);
if($result)
{
echo '<tr>
<td><input type=text name=id_emploi size=1 value="'.$result['id_emploi'].'"></td>
<td><input name=date_debut type=text name=date_debut size=10 value="'.$result['date_debut'].'"></td>
<td><input name=date_fin type=text name=date_fin size=10 value="'.$result['date_fin'].'"></td>
<td><input name=poste type=text name=poste size=30 value="'.$result['poste'].'"></td>
<td><input name=type_contrat type=text name=type_contrat size=10 value="'.$result['type_contrat'].'"></td>
<td><input name=entreprise type=text name=entreprise size=40 value="'.$result['entreprise'].'"></td>
}
echo '</table>';
?>
[b]Ma page1:[/b]
[php]<?php
require ("Connect.php");
$connexion = mysql_pconnect (SERVEUR, NOM, PASSE);
mysql_select_db (BASE,$connexion);
$sql = mysql_query("SELECT * FROM emploi WHERE id='$_SESSION[id]'");
while($result=mysql_fetch_array($sql))
{
echo '<tr class=etiquette>
<td width=0 height=20><input type="texte" name="id_emploi" size="1" value="' .$result['id_emploi'].'"></td>
<td width=60 height=20>' .$result['date_debut'].'</td>
<td width=60 height=20>' .$result['date_fin'].'</td>
<td width=220 height=20>' .$result['poste'].'</td>
<td width=50 height=20>' .$result['type_contrat'].'</td>
<td width=300 height=20>' .$result['entreprise'].'</td>
<td class=supp width=0 height=20><a href=" memo_experiences.php?id='.$result['id_emploi'].'"
onclick="return(confirm(\'Etes-vous sûr de vouloir supprimer ces informations?\'));" >Supprimer</a></td>
<td class=supp width=0 height=20><a href="memo_experiences_modif.php?id ='.$result['id_emploi'].'">modifier</a></td>
</tr>';
}
?>[/php]
[b]ma page2, après avoir cliqué sur lien modifié:[/b]
[php]<?php
require ("Connect.php");
$connexion = mysql_pconnect (SERVEUR, NOM, PASSE);
mysql_select_db (BASE,$connexion);
$id = $_GET['id_emploi'];
$sql = mysql_query("SELECT * FROM emploi WHERE id='.$_GET[id_emploi].'");
$result = mysql_fetch_array($sql);
echo '<table width=750 border=0 align=center cellpadding=2 cellspacing=1 >
<tr class=memo3_etiquette>
<td width=60 height=20>id</td>
<td width=60 height=20>date_debut</td>
<td width=60 height=20>date_fin</td>
<td width=220 height=20>poste occupé</td>
<td width=50 height=20>contrat</td>
<td width=300 height=20>entreprise</td>
</tr>';
$result = mysql_fetch_array($sql);
if($result)
{
echo '<tr>
<td><input type=text name=id_emploi size=1 value="'.$result['id_emploi'].'"></td>
<td><input name=date_debut type=text name=date_debut size=10 value="'.$result['date_debut'].'"></td>
<td><input name=date_fin type=text name=date_fin size=10 value="'.$result['date_fin'].'"></td>
<td><input name=poste type=text name=poste size=30 value="'.$result['poste'].'"></td>
<td><input name=type_contrat type=text name=type_contrat size=10 value="'.$result['type_contrat'].'"></td>
<td><input name=entreprise type=text name=entreprise size=40 value="'.$result['entreprise'].'"></td>
}
echo '</table>';
?>[/php]