Jump to content
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Résolu]formulaire + SQL

Featured Replies

Voilà, j'ai un site à faire pour les cours et j'ai un petit soucis.

Je fais un site où les membres peuvent faire une liste de leurs albums de musiques. J'ai donc codé un formulaire où à un moment je leur donne le choix entre plusieurs appréciations :

          <tr>
   	<td>Appréciation</td>
                   
   	<td><select name= "appreciation">
      
                         <option>10/10 : Le pied, l'extase                   </option>
                         <option>09/10 : Excellent                           </option>
                         <option>08/10 : Très Bien                           </option>
                         <option>07/10 : Bon                                 </option>
                         <option>06/10 : Mouais                              </option>
                         <option>05/10 : Boaf                                </option>
                         <option>04/10 : Moins fun qu'un cd vierge           </option>
                         <option>03/10 : Pourquoi j'ai ça ?                  </option>
                         <option>02/10 : A éviter absolument !!              </option>
                         <option>01/10 : Je devrais le donner à ma belle mère</option>
                         <option>00/10 : C'est le préféré de belle maman     </option>
                         
                     </select>	</td>	
         </tr>

Les informations sont envoyés sur la page traite_albums.php où elles sont envoyés sur à la bdd :

$Requete="INSERT into ZK_Albums values('$artiste','$titre_album','$format','$annee','$appreciation');";

Seulement voilà, ça plante sur les phrases "Le pied, l'extase", "Pourquoi j'ai ça ?" et "C'est le préféré de belle maman" à cause des apostrophes...

Y a t-il un moyen d'éviter ce problème ou je dois changer les phrases pour éviter d'avoir des apostrophes ?

Merci. :chinois:

Edited by Doklix

  • Author
addslashes(); pour l'enregistrement et

stripslashes(); pour l'afficahge plus tard...

Merci, ça fonctionne niquel ;)

Archived

This topic is now archived and is closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.