Eléphant du PHP |
187 Messages
09 déc. 2011, 14:31
ok merci!
voilà le code de la 1er page:
<?php
include( 'connexion.php' );
<form method="post" action="enregisterV.php">
<table width="1399" border="0">
<tr>
<th width="144" height="26" bgcolor="#FFFFCC" ><span class="style14 style6">Medecin</span></th>
<th width="25" bgcolor="#FFFFCC"> <span class="style14 style6">ech-remis</span></th>
</tr>
<td width="62">
<select name="nom" class="style14" id="nom">
<option selected="selected" value="">Selectionnez :</option>
<option value="Oui">Oui</option>
<option value="Non">Non</option>
<option value="Autre">Autre</option>
</select>
</td>
<td width="62">
<select multiple name="ech-remis[]" id="ech-remis" class="style14" >
<option selected="selected" value="">Selectionnez :</option>
<option value="Maxi_G ">Maxi G </option>
<option value="Maxi_20">Maxi 20</option>
<option value="Trivimag">Trivimag </option>
<option value="Biosept">Biosept</option>
<option value="Hepanat">Hepanat </option>
<option value="Dornat_Plus">Dornat Plus</option>
<option value="Panax_Effervescent">Panax Effervescent </option>
<option value="Extraform_Sirop">Extraform Sirop</option>
<option value="Erbaven">Erbaven</option>
<option value="Centelys">Centelys</option>
</select></td>
</tr>
</table>
<table width="1110" align="center" cellpadding="3">
<tr align="right" valign="top">
<th width="668" height="30" scope="row"> </th>
<td width="653"> </td>
</tr>
<tr align="right" valign="top">
<th width="355" height="30" scope="row"><label>
<input name="enregistrer" class="Style1" value="Enregistrer" style="width: 25%" type="submit" />
</label>
</th>
<td width="358"><div align="left">
<input name="reset" type="reset" id="submit" value="vider" class="Style1" style="width: 25%"/>
</div></td>
</tr>
</table>
</form>
/2 eme page: enregistrerV :
alors le code d'insert:
<?php session_start() ;
ob_start();
include( 'connexion.php' );
$m=$_POST['nom'];
$n=$_POST['ech-remis'];
$z=mysql_query('insert into
visiter values
("","'.addslashes($m).'","'.addslashes($n).'")') or die(mysql_error());
//echo " bien enregistrée";
header('Location: ll.php') ;
j'ai éliminé le reste des champs pour réduire le code ,merci pour votre aide.