Jump to content
Larry Ullman's Book Forums

cremona

Members
  • Posts

    1
  • Joined

  • Last visited

cremona's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. My question is, which is the best way to make a form input "sticky" using both stripslashes and htmlspecialchars, namely what is the proper order of the two: <input type="text" name="firstName" size="30" maxlength="30" value="'; if(isset($_POST['firstName'])) echo stripslashes(htmlspecialchars($_POST['firstName'], ENT_QUOTES)); echo '" /> -or- <input type="text" name="firstName" size="30" maxlength="30" value="'; if(isset($_POST['firstName'])) echo htmlspecialchars(stripslashes($_POST['firstName']), ENT_QUOTES); echo '" /> They both yield the same results when using a value such as O'Schmalley McGee <input type="text" name="firstName" size="30" maxlength="30" value="O&#039;Schmalley McGee" /> But which one is technically "better?" Thank you in advance and God Bless Larry Ullman for being a fantastic author!
×
×
  • Create New...