Bonjour,
j'ai une question :
j'ai un code dans la page "affiche.php" qui je doit remplire le champ "type_offre".
voila le code :
et voila le code de la page "indexer.php"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 <?php <form method="post"> <table class="indexation"> <tr> <td align="left" valign="top"> <p> <strong>Faite entré l'URL du site</strong></p></td> <td align="left" width="500px;"> <input name="url" value="<?php if (isset($_POST['url'])) echo htmlentities(trim($_POST['url'])); ?>" type="text" size="50"/> </td> <tr/> <tr> <td align="left" valign="top" style="width:200px;"> <p> <strong>Type d'offre</strong></p></td> <td align="left"> <select name="type_offre" style="font-size:15px; "> <option value="stage"> Stage</option> <option value="emploi">Emploi</option> </select> </td> </tr> </table> <input class="valider" style="font-size:13px; width:200px; "type="submit" value= "Valider Indexation"> </form> ?> </body> </html> <?php if((isset($_POST["url"]))&&(isset($_POST["type_offre"]))&&(isset($_POST["resume"]))) if((!empty ($url))&&(!empty ($type_offre))&&(!empty ($resume))) { echo("<META HTTP-equiv=\"refresh\" content=0;URL=indexation.php?url=$url and type_offre=$type_offre>"); //envoyer le champ "type_offre" } ?>
mais ça marche pas elle affiche un message d'erreur.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 <?php $code = $_GET['url']; $type_offre = $_GET['type_offre']; //insere dans la base de données $sql1="INSERT INTO document (url,titre,resume,code_doc,<gras>type_offre</gras>) VALUES ('".$code."','".$champs1_titre."','".$champs1_descr."','".$aRes[0]."',<gras>'".$type_offre."'</gras>)"; ?>
elle afficher un message d'erreur comme ça:
Notice: Undefined index: type_offre in e:\easyphp1-8\www\new-usthb2\administrateur\indexation.php
svp de me répondre.
merci d'avance.
Partager