Professional Web Applications Themes

Internet Config, LaunchURLC Help... - Mac Programming

Hi.. I'm writing a program (C, Carbon, CW8) and need to send a URL to a browser from within the running program which sends some info to a php script. So, I check for Internet Config, and if all is well, I call a function...like so...sending an integer and a text string to my php script... LaunchURLC("\phttp://www.something.com/test.php?abc=1234&def=Hello%20The re); The problem seems to be with the "%20". I know (or thought I knew!) that URL's can't include a space character, so in my C program, when I create the URL to send, I convert spaces to "%20"'s myself. This works fine ...

  1. #1

    Default Internet Config, LaunchURLC Help...

    Hi..

    I'm writing a program (C, Carbon, CW8) and need to send a URL to a
    browser from within the running program which sends some info to a php
    script. So, I check for Internet Config, and if all is well, I call a
    function...like so...sending an integer and a text string to my php
    script...


    LaunchURLC("\phttp://www.something.com/test.php?abc=1234&def=Hello%20The
    re);

    The problem seems to be with the "%20". I know (or thought I knew!)
    that URL's can't include a space character, so in my C program, when I
    create the URL to send, I convert spaces to "%20"'s myself. This works
    fine for many users and for myself as well.

    But, (so far), on one users machine, this does NOT work...as the URL
    that he ends up sending looks like this...

    LaunchURLC("\phttp://www.something.com/test.php?abc=1234&def=Hello%2520T
    here);

    Note, both URL's are the same EXCEPT that his browser converted MY
    "%20" into a "%2520". Obviously, his browser interpreted my initial "%"
    and converted it into its equivalent "%25", and then tacked on the 20
    at the end. Obviously not what I wanted.

    So, two questions come to mind...

    1 - Why did his browser auto-convert my "%" into a "%25", yet my
    browser did NOT? (We both run Safari, but I'm not sure of his
    version...probably an older version)

    2 - Also, might the mistake be mine? Maybe I shouldn't be converting
    spaces in the text field "Hello There" to "%20" myself? Does
    LaunchURLC() do that for me? (and why on only some browsers?)

    Interesting problem. Ring a bell for anyone?

    Thanks!

    George
    George Guest

  2. #2

    Default Re: Internet Config, LaunchURLC Help...

    In article <060720042357240466%com>,
    George <com> wrote:
     

    %20 is the correct encoding for a space in the username, password, and path, but
    in the query section (after ?) you need to use + to encode the space IIRC

    hth

    meeroh

    --
    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist>

    Miro Guest

  3. #3

    Default Re: Internet Config, LaunchURLC Help...

    In article <mit.edu>,
    Miro Jurisic <org> wrote:

    Thanks! That must be it. (BTW...I did find out that the user with the
    problem did have a very old copy of Safari...so though I was mistaken
    in how I encoded the line in the first place, it was handled correctly
    in the newer Safari and incorrectly in the older Safari...just FYI.

    Again, thanks...I'll try what you suggest...
    George Guest

Similar Threads

  1. lauch services versus internet config
    By Jhnny in forum Mac Programming
    Replies: 4
    Last Post: February 24th, 07:53 AM
  2. Internet Config
    By Earle in forum Mac Applications & Software
    Replies: 3
    Last Post: August 11th, 09:50 PM
  3. Microsoft VPN and Norton Internet Security 2003 Config
    By Mark Swift [MSFT] in forum Windows Networking
    Replies: 0
    Last Post: June 30th, 08:02 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139