<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.6000.16609" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New" size=2>It was a long day yesterday and 
I&nbsp;failed to&nbsp;notice the 'obvious'!</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Base64 breaks 8 bit bytes into 6 bit chunks 
and uses the '=' padding character to make up the shortfall when the number of 
characters encoded is not exactly divisible by 3. I had added leading zeros to 
my record ID to make it 4 digits thus&nbsp;'==' would always be added to the 
end. 4 digits was just an arbitrary figure so increasing it to 6 solved the 
problem!</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Thanks to everyone who offered a 
suggestion</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Roger</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV style="FONT: 10pt arial">----- Original Message ----- 
<DIV style="BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A 
title=rp272@cam.ac.uk href="mailto:rp272@cam.ac.uk">Roger Price</A> </DIV>
<DIV><B>To:</B> <A title=fx.php_list@mail.iviking.org 
href="mailto:fx.php_list@mail.iviking.org">FX.php Discussion List</A> </DIV>
<DIV><B>Sent:</B> Tuesday, March 04, 2008 7:12 PM</DIV>
<DIV><B>Subject:</B> Re: [FX.php List] [OFF] sending email 
confirmation</DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face="Courier New" size=2>Thank you for all your suggestions. It 
seems that it is a well known problem&nbsp; for which UTF-7 Modified Base64 was 
developed which does not use the '='.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>The '=' is a padding character which only 
appears at the end of an encoded string and then only as a single or double. I 
tried replacing it with other characters inc '_' but OE still ignored 
them.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Finally I did a str_replace' exchanging '=' 
with ';1' and '==' with ';2'. Having a digit as the last character seems to fool 
OE. I haven't yet tried it with Entouage but I expect it will be fine. The code 
I used was:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>if(substr($hash,-2,2)=='==') {$hash = 
str_replace('==',';2',$hash);}<BR>if(substr($hash,-1,1)=='=')&nbsp; {$hash = 
str_replace('==',';1',$hash);}</FONT></DIV>
<DIV>
<P><FONT face="Courier New" size=2>where $hash was the original base64 encoded 
'recid'</FONT></P>
<P><FONT face="Courier New" size=2>This can of course be easily reversed on the 
target page. It is not a very elegant solution but works well enough.</FONT></P>
<P><FONT face="Courier New" size=2>Roger</FONT></P></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>----- Original Message ----- </FONT></DIV>
<DIV>
<DIV><FONT face="Courier New" size=2>From: "Chris Hansen" &lt;</FONT><A 
href="mailto:chris@iViking.org"><FONT face="Courier New" 
size=2>chris@iViking.org</FONT></A><FONT face="Courier New" 
size=2>&gt;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>To: "FX.php Discussion List" &lt;</FONT><A 
href="mailto:fx.php_list@mail.iviking.org"><FONT face="Courier New" 
size=2>fx.php_list@mail.iviking.org</FONT></A><FONT face="Courier New" 
size=2>&gt;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Sent: Tuesday, March 04, 2008 4:46 
PM</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Subject: Re: [FX.php List] [OFF] sending 
email confirmation</FONT></DIV></DIV>
<DIV><FONT face="Courier New"><BR><FONT size=2></FONT></FONT></DIV><FONT 
face="Courier New" size=2>Roger,<BR><BR>Andrew has the right approach 
here.&nbsp; The base64_encode() is great for&nbsp; <BR>encoding things in a way 
which makes them not readily recognizable,&nbsp; <BR>but any string that goes 
into a url which may have non-alphanumeric&nbsp; <BR>characters in it needs to 
be urlencoded. period.&nbsp; This is fundamental&nbsp; <BR>to working with the 
web and would even affect putting a text field&nbsp; <BR>into a URL (those 
spaces will cause you problems) or comparing one way&nbsp; <BR>hashes.&nbsp; For 
more information about encoding, check out the PHP docs:<BR><BR></FONT><A 
href="http://us.php.net/manual/en/function.urlencode.php"><FONT 
face="Courier New" 
size=2>http://us.php.net/manual/en/function.urlencode.php</FONT></A><BR><A 
href="http://us.php.net/manual/en/function.rawurlencode.php"><FONT 
face="Courier New" 
size=2>http://us.php.net/manual/en/function.rawurlencode.php</FONT></A><BR><BR><FONT 
face="Courier New" size=2>So most likely what you want to do is first come up 
with an&nbsp; <BR>unrecognizable string, and then be sure to urlencode it.&nbsp; 
Just one&nbsp; <BR>extra step, and you should be fine.&nbsp; HTH<BR><BR>--Chris 
Hansen<BR>&nbsp;&nbsp; FileMaker 8 Certified Developer<BR>&nbsp;&nbsp; FileMaker 
7 Certified Developer<BR>&nbsp;&nbsp; Creator of FX.php<BR>&nbsp;&nbsp; "The 
best way from FileMaker to the Web."<BR>&nbsp;&nbsp; </FONT><A 
href="http://www.iViking.org"><FONT face="Courier New" 
size=2>www.iViking.org</FONT></A><BR><BR><FONT face="Courier New" size=2>On Mar 
4, 2008, at 8:36 AM, Andrew Denman wrote:<BR><BR>&gt; Roger,<BR>&gt;<BR>&gt; 
Since the equal sign is a special character for URLs, it is a good&nbsp; 
<BR>&gt; idea to not use them in your data if possible.&nbsp; If you must use 
the&nbsp; <BR>&gt; equal signs, you should URL encode them to ensure they 
work&nbsp; <BR>&gt; everywhere.<BR>&gt;<BR>&gt; In FileMaker there is the 
GetAsURLEncoded() function, and in PHP&nbsp; <BR>&gt; there is the 
rawurlencode() function.<BR>&gt;<BR>&gt; Andrew Denman<BR>&gt;<BR>&gt; From: 
</FONT><A href="mailto:fx.php_list-bounces@mail.iviking.org"><FONT 
face="Courier New" size=2>fx.php_list-bounces@mail.iviking.org</FONT></A><FONT 
face="Courier New" size=2> [mailto:fx.php_list-bounces@mail.iviking.org <BR>&gt; 
] On Behalf Of Steve Winter<BR>&gt; Sent: Tuesday, March 04, 2008 9:15 
AM<BR>&gt; To: 'FX.php Discussion List'<BR>&gt; Subject: RE: [FX.php List] [OFF] 
sending email confirmation<BR>&gt;<BR>&gt; Hi Roger,<BR>&gt;<BR>&gt; I presume 
that the presence of the two == are a function of&nbsp; <BR>&gt; 
base64_encode…?? If not, what purpose do they serve…?<BR>&gt;<BR>&gt; Perhaps 
using an alternative encoding method (eg md5) might resolve&nbsp; <BR>&gt; the 
issue, since it would not result in == characters…??<BR>&gt;<BR>&gt; 
Cheers<BR>&gt; Steve<BR>&gt;<BR>&gt; From: </FONT><A 
href="mailto:fx.php_list-bounces@mail.iviking.org"><FONT face="Courier New" 
size=2>fx.php_list-bounces@mail.iviking.org</FONT></A><FONT face="Courier New" 
size=2> [mailto:fx.php_list-bounces@mail.iviking.org <BR>&gt; ] On Behalf Of 
Roger Price<BR>&gt; Sent: 04 March 2008 15:10<BR>&gt; To: FX.php Discussion 
List<BR>&gt; Subject: [FX.php List] [OFF] sending email 
confirmation<BR>&gt;<BR>&gt; As part of a web project I am collecting data from 
our some of our&nbsp; <BR>&gt; past students that we have lost contact 
with.<BR>&gt;<BR>&gt; I want to try to ensure that we don't get too many 
malicious returns&nbsp; <BR>&gt; so I intend to send a confirmation to the 
entered email address with&nbsp; <BR>&gt; an activation link.<BR>&gt;<BR>&gt; So 
far so good!<BR>&gt;<BR>&gt; In order that the database record key is not 
blatantly obvious I'm&nbsp; <BR>&gt; using base64_encode!<BR>&gt;<BR>&gt; 
however when I mail a link such as:&nbsp; http:// <BR>&gt; </FONT><A 
href="http://www.xxx.xxx.xx.xx..edit2.html?rec=MDAwMQ"><FONT face="Courier New" 
size=2>www.xxx.xxx.xx.xx..edit2.html?rec=MDAwMQ</FONT></A><FONT 
face="Courier New" size=2>==<BR>&gt; the two '=' characters that are generated 
at the end of this&nbsp; <BR>&gt; particular record are omitted from the 
hyperlink when viewed in&nbsp; <BR>&gt; Outlook Express or Windows Mail. 
Entourage only omits one! However&nbsp; <BR>&gt; Outlook and my webmail program 
work perfectly.<BR>&gt;<BR>&gt; If anybody resolved this problem before I would 
be grateful to know&nbsp; <BR>&gt; the best way.<BR>&gt;<BR>&gt; 
Roger<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; 
_______________________________________________<BR>&gt; FX.php_List mailing 
list<BR>&gt; </FONT><A href="mailto:FX.php_List@mail.iviking.org"><FONT 
face="Courier New" size=2>FX.php_List@mail.iviking.org</FONT></A><BR><FONT 
face="Courier New" size=2>&gt; </FONT><A 
href="http://www.iviking.org/mailman/listinfo/fx.php_list"><FONT 
face="Courier New" 
size=2>http://www.iviking.org/mailman/listinfo/fx.php_list</FONT></A><BR><BR><FONT 
face="Courier New" 
size=2>_______________________________________________<BR>FX.php_List mailing 
list<BR></FONT><A href="mailto:FX.php_List@mail.iviking.org"><FONT 
face="Courier New" size=2>FX.php_List@mail.iviking.org</FONT></A><BR><A 
href="http://www.iviking.org/mailman/listinfo/fx.php_list"><FONT 
face="Courier New" 
size=2>http://www.iviking.org/mailman/listinfo/fx.php_list</FONT></A><BR></BODY></HTML>