Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: html characters

  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    html characters

    i am currently using the following to validiity form fields
    $email=stripslashes(htmlspecialchars($_POST['email']));

    thats fine and all, but i would like the user to be able to login using their email but htmlspecialchars filters out @. what is another way to secure my forms but allow users to login with their email?

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,796
    Thanks
    19
    Thanked 156 Times in 147 Posts
    don;t think htmlspecialchars converts the @ symbol: http://us2.php.net/manual/en/functio...ecialchars.php

    you sure you're not using htmlentities(http://us2.php.net/manual/en/function.htmlentities.php)?
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!

  • #3
    New Coder
    Join Date
    Apr 2006
    Location
    Pakistan
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    function myurlencode $TheVal )
    {
     return 
    urlencode (str_replace("@","%40",$TheVal));
    }

    $emailmyurlencode($_POST['email']); 
    this could help you maybe?

  • #4
    Regular Coder trib4lmaniac's Avatar
    Join Date
    Feb 2004
    Location
    Cornwall, UK
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why do you need to filter out HTML characters anyway? You only need to escape data before you output it (for this sort of validation anyway; you still need to check for things like SQL injections in certain cases).

  • #5
    New Coder
    Join Date
    Dec 2005
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what should i use that is both secure and allows member to use their email as their login?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •