jalea148 Posted November 20, 2007 Share Posted November 20, 2007 I’m using a Get to pass data to the next page. With Internet Explorer there are no problems. With Firefox, the @ symbol in the email address is translated into %40. This causes a problem in this snippet: <input type="hidden" name="from" value="<?php echo $_GET['Email']; ?>" [[email protected] comes through as customer%40alltel.net in Firefox] What fixes are available? Thank you. Jay Quote Link to comment https://forums.phpfreaks.com/topic/78099-firefox-translation-of-email-in-get/ Share on other sites More sharing options...
PHP_PhREEEk Posted November 20, 2007 Share Posted November 20, 2007 In the <form> tag, use POST instead of GET would be the obvious answer. Other than that, you can use a string function to convert the %40 back to an @ symbol. PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/78099-firefox-translation-of-email-in-get/#findComment-395262 Share on other sites More sharing options...
jalea148 Posted November 20, 2007 Author Share Posted November 20, 2007 In the <form> tag, use POST instead of GET would be the obvious answer. Other than that, you can use a string function to convert the %40 back to an @ symbol. PhREEEk Something like this? <input type="hidden" name="from" value="<?php echo strtr($_GET['Email'],'%40','@'); ?>" Jay Quote Link to comment https://forums.phpfreaks.com/topic/78099-firefox-translation-of-email-in-get/#findComment-395392 Share on other sites More sharing options...
PHP_PhREEEk Posted November 20, 2007 Share Posted November 20, 2007 No... you need to convert it AFTER it is received by the processing script, and you need to use str_replace, not strstr... The processing script... <?php if ( !empty($_GET['Email']) ) { $email = str_replace("%40", "@", $_GET['Email']); } Testing it... <?php $_GET['Email'] = 'customer%40alltel.net'; if ( !empty($_GET['Email']) ) { $email = str_replace("%40", "@", $_GET['Email']); } echo "Email = $email"; ?> PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/78099-firefox-translation-of-email-in-get/#findComment-395411 Share on other sites More sharing options...
trq Posted November 20, 2007 Share Posted November 20, 2007 Best to use urldecode(). <?php if ( !empty($_GET['Email']) ) { $email = urldecode($_GET['Email']); echo "Email = $email"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/78099-firefox-translation-of-email-in-get/#findComment-395414 Share on other sites More sharing options...
jalea148 Posted November 21, 2007 Author Share Posted November 21, 2007 Best to use urldecode(). <?php if ( !empty($_GET['Email']) ) { $email = urldecode($_GET['Email']); echo "Email = $email"; } ?> Works like a charm. Thanx Jay Quote Link to comment https://forums.phpfreaks.com/topic/78099-firefox-translation-of-email-in-get/#findComment-396120 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.