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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Hidden PHP values html form

  • 13-11-2006 4:03pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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