Jump to content

Firefox translation of email '@' in Get


jalea148

Recommended Posts

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']; ?>"

 

[customer@alltel.net comes through as customer%40alltel.net in Firefox]

What fixes are available? Thank you. Jay

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.