Use htmlentities or rawurlencode to add text to a form text

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

Use htmlentities or rawurlencode to add text to a form text

Post by WaldoMonster »

Use htmlentities or rawurlencode to add text to a form text field.

Code: Select all

<input type="text" name="input" value="<?php echo htmlentities($default_text); ?>">
<input type="text" name="input" value="<?php echo rawurlencode ($default_text); ?>">
Both they seam to work.

<edit>
It must be htmlentities.
Sorry for posting :oops:
</edit>
Post Reply