dongshaoxiong0012 2017-10-22 19:50
浏览 50

跨度变量没有在php中读取

I have a website that receives parameters in the URL address (www.xxx.html?name=David)

then I assign the value to the html text like this:

<span name="uname" id="uname"> </span>, I'd like to thank you 

<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
     var userName = getParameterByName('uname');
     document.getElementById("uname").textContent = userName;
});
</script>

up to this point everything works well

now when I try to read again the value in uname in the PHP file in order to send it in the email I have two issues

  1. the parameter is not received - emailText = $_POST['uname'];
  2. when trying to debug I see the HTML file and js file being loaded and can be debugged but the PHP file doesn't exist in the file tree of the debug

BUT it is being loaded and read because other variables are being read and sent correctly to the email.

  • 写回答

3条回答 默认 最新

  • dongtang6681 2017-10-22 19:56
    关注

    You cannot use span with name attribute.

    Read this https://www.w3schools.com/tags/tag_span.asp

    If you want to post, use form + proper input element.

    https://www.w3schools.com/html/html_form_input_types.asp

    And still, it's not very clear you are really trying to do, show us the whole page ...

    评论

报告相同问题?

悬赏问题

  • ¥15 对于知识的学以致用的解释
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败