Toon posts:

[PHP] Probleem met aanhalingstekens

Pagina: 1
Acties:
  • 33 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb het volgende probleem:

Als ik deze code gebruik op een pagina

<form action="pagina.php" method="post">

<textarea name="tekst"> Bijvoorbeeld deze "tekst" </textarea>

<input type="submit" value="Verstuur">

</form>

En op de pagina 'pagina.php' plaats ik deze code:

<?php

echo $_POST['tekst'];

?>

Dan zet het script niet ' Bijvoorbeeld deze "tekst ' op die pagina, maar dan zet 'ie het volgende erneer: ' Bijvoorbeeld deze \"tekst\" '.

Iemand enig idee hoe dit kan en hoe ik het kan voorkomen??

  • Michali
  • Registratie: Juli 2002
  • Laatst online: 22-03 18:12
echo stripslashes($_POST['tekst']);

:)

Noushka's Magnificent Dream | Unity


Verwijderd

Volgens mij gaat het ook met htmlspecialchars

http://nl3.php.net/manual/nl/function.htmlspecialchars.php

Verwijderd

Topicstarter
Oké, het werkt!
Hartstikke bedankt, ik kan weer verder ;)

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

stripslashes (), maar wat belangrijker is: set_magic_quotes_runtime () en vooral get_magic_quotes_gpc () om het waarom van die slashes.

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


Dit topic is gesloten.