I'm building a form which creates a link with variable information in it. I'm using the following bit of code in the "On submit code - after sending email" box:
<?php
$baseurl = "https://www.xxxxxxxxxxx.nl/tft/authentication.jsp";
$psk = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$organisation="605";
// SSO code is time dependent !
$time = date("YmdH");
$ssocode= md5($time . $iduser . $psk);
// NOTE URL ENCODING
echo " <a href=\"" , $baseurl ,
"?iduser=" , urlencode($_POST['lastname']. $_POST['emailaddress']) ,
"&organisation=" , $organisation ,
"&lastname=" , urlencode($_POST['lastname']) ,
"&emailaddress=" , urlencode($_POST['emailaddress']) ,
"&infix=" , urlencode($_POST['infix']) ,
"&initials=" , urlencode($_POST['initials']) ,
"&bron=" , urlencode($_POST['bron']),
"&ssocode=" , $ssocode , "\"><img src=\"/images/stories/submitpage.jpg\"></a>"; ?>
Everything works fine, the link is created with the information that is filled in in the form. An example of the link is:
https://www.xxxxxxxxxxx.nl/tft/authentication.jsp?iduser=HaafEmail%40email.com&organisation=605&lastname=Haaf&emailaddress=Email%40email.com&infix=ten&initials=P&bron=&ssocode=120d2fd2eac971c12ceb3dca67eb351e
The problem I have is when an email address is used in the form. In the example above, I have used [email]email@email.com[/email]
The email address is incorrectly stored in the link as email%40email.com
Is it possible to correct this?
<?php
$baseurl = "https://www.xxxxxxxxxxx.nl/tft/authentication.jsp";
$psk = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$organisation="605";
// SSO code is time dependent !
$time = date("YmdH");
$ssocode= md5($time . $iduser . $psk);
// NOTE URL ENCODING
echo " <a href=\"" , $baseurl ,
"?iduser=" , urlencode($_POST['lastname']. $_POST['emailaddress']) ,
"&organisation=" , $organisation ,
"&lastname=" , urlencode($_POST['lastname']) ,
"&emailaddress=" , urlencode($_POST['emailaddress']) ,
"&infix=" , urlencode($_POST['infix']) ,
"&initials=" , urlencode($_POST['initials']) ,
"&bron=" , urlencode($_POST['bron']),
"&ssocode=" , $ssocode , "\"><img src=\"/images/stories/submitpage.jpg\"></a>"; ?>
Everything works fine, the link is created with the information that is filled in in the form. An example of the link is:
https://www.xxxxxxxxxxx.nl/tft/authentication.jsp?iduser=HaafEmail%40email.com&organisation=605&lastname=Haaf&emailaddress=Email%40email.com&infix=ten&initials=P&bron=&ssocode=120d2fd2eac971c12ceb3dca67eb351e
The problem I have is when an email address is used in the form. In the example above, I have used [email]email@email.com[/email]
The email address is incorrectly stored in the link as email%40email.com
Is it possible to correct this?
Hi pth,
That's the url encoded version of the email address so it's probably correct.
Bob
That's the url encoded version of the email address so it's probably correct.
Bob
Thanks for the quick reply.
I don't know why I used "urlencode" in my code, probably copied it from somewhere. I removed the "urlencode" part, the email address is now included correctly. Thanks again.
I don't know why I used "urlencode" in my code, probably copied it from somewhere. I removed the "urlencode" part, the email address is now included correctly. Thanks again.
This topic is locked and no more replies can be posted.
