When I append "¤cy" to my string, the "¤" portion gets
replaced with this character:
¤
I've looked in the PHP docs and can't find anything referencing
¤ as a special case variable or anything.
Anyone know what's going on? (PHP4)
Thanks for any help.
--
Richard Joseph
Email: use...@rjsoftware.com
Internet: http://www.rjsoftware.com/
RJ Software - Practical Applications for the Digital Universe
You should use & to seperate your vars
dj
Thank you. It appears that "¤" is HTML for the currency
symbol, so I guess it isn't as bizzare as I'd thought.
Here's what I did to make my URL work:
Instead of
http://www.whatever.com?this=1&that=2¤cy=USD
I put:
http://www.whatever.com?currency=USD&this=1&that=2
>
>I'm trying to build a URL as a string and ran into something odd.
>
>When I append "¤cy" to my string, the "¤" portion gets
>replaced with this character:
>
>€
>
>I've looked in the PHP docs and can't find anything referencing
>¤ as a special case variable or anything.
>
>Anyone know what's going on? (PHP4)
Several things at the same time...
& in HTML needs to be represented as &
There are many of these 'character entities' where '&something;' represents a
character. One of them is ¤
<!ENTITY curren CDATA "¤" -- currency sign, U+00A4 ISOnum -->
That's the universal currency symbol:
http://oss.software.ibm.com/cgi-bin/icu/ub/utf-8/?ch=00A4
Whether your browser should have converted ¤ without a trailing ; to
that symbol is questionable; however it is wrong in the first place that you
haven't changed & to &
However, there's another snag; have you specified a character set? There are
many standards to choose from. Your post says the character is:
>€
... which appears as Euro here (and hopefully should appear as Euro when I
post this, because I'll be choosing a character set that contains Euro when I
hit send and my newsreader prompts me for a character set).
Is that what appeared on the page, or has some conversion problem happened in
the post? Your post doesn't have a character set specified, so that character
is probably invalid (isn't the default for NNTP 7bit if no character set is
specified?) and at least is ambiguous.
Various character sets have Euro and universal currency symbol in conflicting
positions, or not present at all, which causes headaches:
| iso8859-1 | iso8859-15 | windows-1252
------------+-----------+------------+--------------
U. Currency | 164 | n/a | 164
Euro | n/a | 164 | 128
Even more details on this page:
http://czyborra.com/charsets/iso8859.html
--
Andy Hassall (an...@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Do not depend on this. Users can rearrange GET variables and it should
return the same page.
It is better to use &.
John Gaughan
jo...@johngaughan.net
>> http://www.whatever.com?currency=USD&this=1&that=2
>
> Do not depend on this. Users can rearrange GET variables and it
> should return the same page.
>
> It is better to use &.
Thanks. The medthod used is POST, so hopefully it shouldn't be a
problem.
However, using & forces the string to appear OK in my browser,
when it gets to the server where the processing script is, it
converts it back to ¤ and messes it up again. I don't think I
have much choice but to put it at the front of the URL's variable
list.
>>I've looked in the PHP docs and can't find anything referencing
>>¤ as a special case variable or anything.
>>
>>Anyone know what's going on? (PHP4)
>
> Several things at the same time...
>
> & in HTML needs to be represented as &
Got it, thanks.
> Whether your browser should have converted ¤ without a
> trailing ; to
> that symbol is questionable; however it is wrong in the first
> place that you haven't changed & to &
You're right. It's not just my browser, however, as the
destination script (on another server, beyond my control) manages
to reconvert it back to the currency symbol whether I send it there
(via POST) as ¤cy or &currency.
> However, there's another snag; have you specified a character
> set?
Yes. iso-8859-1.
> There are
> many standards to choose from. Your post says the character is:
>
>>€
>
> ... which appears as Euro here (and hopefully should appear as
> Euro when I
> post this, because I'll be choosing a character set that
> contains Euro when I hit send and my newsreader prompts me for a
> character set).
>
> Is that what appeared on the page, or has some conversion
> problem happened in
> the post?
No, it appears the same in both - but it's not the Euro character.
> Your post doesn't have a character set specified, so
> that character is probably invalid (isn't the default for NNTP
> 7bit if no character set is specified?) and at least is
> ambiguous.
Hmm. I'm using XNews, and I don't see an option to change the
character set. Maybe I need to insert a custom header such as
Content-Type: text/plain; charset=ISO-8859-15? I just did it for
this post, but I don't know if it will make any difference.
variables are only passed in the url using the GET method. With the POST
method thay are in the http header and are therefore invisible. The order of
the variables is also irrelevant as they are referenced by name, not
sequence.
Tony Marston
>> Thanks. The medthod used is POST, so hopefully it shouldn't be
>> a problem.
>
> variables are only passed in the url using the GET method. With
> the POST method thay are in the http header and are therefore
> invisible. The order of the variables is also irrelevant as they
> are referenced by name, not sequence.
That's good to know, thanks.
So that means you are using something like:
<form method="post"
action="http://www.whatever.com?currency=USD&this=1&that=2">
<input type="submit">
</form>
???
If so, why not use:
<form method="post" action="http://www.whatever.com">
<input type="hidden" name="currency" value="USD">
<input type="hidden" name="this" value="1">
<input type="hidden" name="that" value="2">
<input type="submit">
</form>
Otherwise you will have entries in both the $_GET and $_POST arrays in
the target script which could lead to confusion if you are not careful.
--
Justin Koivisto - sp...@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
> So that means you are using something like:
>
> <form method="post"
> action="http://www.whatever.com?currency=USD&this=1&that=2">
> <input type="submit">
> </form>
>
> ???
Actually, I'm doing this:
<form method="post" action="http://mydomain.com/myscript.php">
That's so I can process the form entries prior to jumping to a
script on a credit card processor on another server that's beyond
my control. "myscript.php" is building the URL and then jumping to
it with header("Location: $the_url");
> If so, why not use:
>
> <form method="post" action="http://www.whatever.com">
> <input type="hidden" name="currency" value="USD">
> <input type="hidden" name="this" value="1">
> <input type="hidden" name="that" value="2">
> <input type="submit">
> </form>
Yes, that's what I'd normally do.
> Otherwise you will have entries in both the $_GET and $_POST
> arrays in the target script which could lead to confusion if you
> are not careful.
Good information, thanks. I don't think there's any way around it
in this case, though. (Is there?)