Results 1 to 8 of 8

Thread: Make Sense Out of Data from Form

  1. #1
    Join Date
    Aug 2006
    Posts
    28
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Make Sense Out of Data from Form

    Yes, I created this form, and I would like to know if it is possible to organize the data that is sent after clicking "submit."

    I would like to eliminate the "ASCII" format letters out of the data that is returned...is that possible?? Or maybe it's not "ASCII" letters but it's a bunch of junk characters.... %&+ and some capital letters and numbers thrown in there too...

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, your question is a bit vague.

    "ASCII" format characters... that's all of 'em. My guess would be that you are referring to extended character sets, like é, ™, ¿, etc. But then you mention capital letters and numbers. Do you want only lowercase letters, then?

    You posted this in the HTML forum, but HTML isn't interpreting anything. That would be with PHP or another serverside language.

    Using PHP, you can do this without too much trouble.

    Check each character using a regular expression, like:
    $string = ereg_replace('[!#$%&\'()*+,-./ :;?@\`{|}~^"]','',$string);

    That will take out all of the characters listed. You could also do the opposite.

    The terms white list and black list apply-- white the only allowed characters, and black being disallowed while all others are.

    I'm not really sure why you are wanting to do this, and there could be a different type of solution in limiting spam in the first place (if this is spam), or limiting in the first place what can be submitted, with clearer directions, or something.

    Can you post a link to your page and give some more info?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    "ASCII" format characters... that's all of 'em.
    No -- Unicode contains many, many more characters than ASCII.
    $string = ereg_replace('[!#$%&\'()*+,-./ :;?@\`{|}~^"]','',$string);
    This is very slow and quite incomprehensive. Instead, split the string and use array_filter(). ctype_alnum() would be preferable, but it doesn't always exist so we may have to create it:
    Code:
    if(!function_exists('ctype_alnum')) {
      $alphabet = array_map('chr', array_merge(range(0x61, 0x7a), range(0x41, 0x5a));
      function ctype_alnum($tr) {
        return is_numeric($tr) || in_array($tr, $alphabet);
      }
    }
    
    function only_alphanumeric($tr) {
      return implode('', array_filter(str_split($tr), 'ctype_alnum'))
    }
    
    $string = only_alphanumeric($tr);
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Aug 2006
    Posts
    28
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Here is the link to the form:

    http://www.bluriradio.com/send/

    Also, I am aware that by submitting form data through HTML, it sends the POSTDATA file (.ptt). The client I am doing this page for cannot view this file, is there another file that I can to the email address? Would that be through some sever-side technology? ASP, or PHP?

  5. #5
    Join Date
    Aug 2006
    Posts
    28
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Another issue that has come up is; that when clicking the "submit" button, IE returns a security error. I don't get these using Firefox, but not everybody is that smart... The error reads:

    This form is being submitted using e-mail.
    Submitting this form will reveal your email address to the recipient, and will send the form data without encrypting it for privacy

    You may continue or cancel this submission

    I understand that this problem may not be avoidable, but I thought I'd just see if anybody had a way to fix or get around this problem.

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Also, I am aware that by submitting form data through HTML, it sends the POSTDATA file (.ptt).
    This depends on the browser and email client.
    The client I am doing this page for cannot view this file
    It's plain text, yes s/he can. However, mailto: forms are ugly and quite unreliable -- you'd be much better off with a proper server-side email script.
    is there another file that I can to the email address? Would that be through some sever-side technology? ASP, or PHP?
    Why a file? Why not just send a normal email?
    I understand that this problem may not be avoidable, but I thought I'd just see if anybody had a way to fix or get around this problem.
    It's a security feature. It shouldn't be avoidable.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Aug 2006
    Posts
    28
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey View Post
    However, mailto: forms are ugly and quite unreliable -- you'd be much better off with a proper server-side email script.
    Do you have an example of an "server-side email script"?

    thanks,
    >b

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    In which language(s)?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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