完整的电子邮件地址通过URL [英] full email id passing in url
问题描述
我是新来的php .i我试图用html和php开发一个应用程序。
i将变量从表单传递给以下给出的url.all代码
i am new to php .i am trying to develop a application with html and php. i passed variable from form to url.all code given below
<FORM METHOD="get" ACTION="action1.php">
Type your first name: <INPUT TYPE="text" NAME="FirstName"> <br/>
Type your last name: <INPUT TYPE="text" NAME="LastName"> <br/>
Type your email:<INPUT TYPE="email" NAME="email">
<INPUT TYPE="submit" VALUE="Click and See">
</FORM>
输出url是 http://example.com/action1.php?FirstName=jon&LastName=Kuri&email=xyz%40abc.com
但我希望它是 http://example.com/action1.php?FirstName=jon&LastName=Kuri&email=xyz@abc.com
如何做。
提前感谢任何建议。
更新:
<?php
$ email =xyz@gmail.com;
$ decode = urldecode($ email);
?>
<FORM METHOD="get" ACTION="action1.php">
Type your first name: <INPUT TYPE="text" NAME="FirstName"> <br/>
Type your last name: <INPUT TYPE="text" NAME="LastName"> <br/>
Type your email:<INPUT type="hidden" NAME="email" value="<?php $decode; ?>">
<INPUT TYPE="submit" VALUE="Click and See">
</FORM>
这也不给我所需的结果。 >
This also does not give me the required result.here i am pre defining email value.
推荐答案
URL被编码,这就是为什么 @
变成% 40
,它来自数据从表单发送的方式/如果您使用 get方法
,这是如何在URL中形成。
但不要担心,你在php中得到的是正确和解码的。
Urls are encoded, that's why @
becomes %40
, it comes from the way data is sent from the form/ If you use get method
, this is how it will be formated in the url.
But don't worry, what you get in php is correct and decoded.
这篇关于完整的电子邮件地址通过URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!