简体   繁体   English

使用JavaScript从URL提取文本并显示在php文件上

[英]Extract text from URL using javascript and display on php file

I have an error message on the URL when wrong password or captcha is added. 添加错误的密码或验证码后,URL上出现错误消息。 Error looks like this on the url: 错误在网址上看起来像这样:

www.domain.com/signup.php?error_msg=The+characters+you+entered+did+not+match+the+word+verification www.domain.com/signup.php?error_msg=您+输入了+ did + not + match + the + word + verify +

How to extract this from URL and display on the PHP file? 如何从URL提取并显示在PHP文件上?

Just use the global $_GET array to retrieve the value: 只需使用全局$_GET数组来检索值:

echo $_GET['error_msg'];

More about this array can be found in the official documentation: http://php.net/manual/en/reserved.variables.get.php 可以在官方文档中找到有关此数组的更多信息: http : //php.net/manual/en/reserved.variables.get.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM