I am trying to create “storage fields”, so if there is one mistake, you will no longer need to fill out the entire form. But how can I make a conclusion safe?
Example:
<input type="text" name="email" value="<?php echo (isset($_POST['email'])) ? htmlspecialchars($_POST['email']) : ''; ?>" />
If someone types "'" (without quotes), for example, you get:
Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\pages\register.php on line 55
So I tried:
<input type="text" name="email" value="<?php echo (isset($_POST['email'])) ? mysql_real_escape_string($_POST['email']) : ''; ?>" />
Then it just adds a lot ///////
What should I do?
I'm no yes. But I thought htmlspecialchars made user input safe?
php
Remy
source share