Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Hidden PHP values html form

Options
  • 13-11-2006 5:03pm
    #1
    Registered Users Posts: 1,086 ✭✭✭


    I have a change username page.

    1st page - Displays form allowing new username entry

    2nd Page - Checks validity of new username and asks for confirmation on change of username. (Username is displayed in form as hidden value)

    3rd page - changes username

    I want to make sure that on the second page I can pass the new_username variable as a hidden form element. Obviously I must consider if someone puts double or single quotes into their username, echoing it normally will disrupt the form value.

    What PHP function accounts for this? Is there any other special characters I should worry about? If I somehow encode it is there a function to decode ?

    Thanks

    Peter


Comments

  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    I dunno maybe:

    [php]
    strip_tags($username)
    [/php]


  • Closed Accounts Posts: 22,479 ✭✭✭✭philologos


    strip_tags should do it or you could use str_replace to remove the " or ' out of the string.


Advertisement