Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP单击链接时,如何将文本分配到页面?_Php_Html_String_Hyperlink_Href - Fatal编程技术网

使用PHP单击链接时,如何将文本分配到页面?

使用PHP单击链接时,如何将文本分配到页面?,php,html,string,hyperlink,href,Php,Html,String,Hyperlink,Href,链接应用于文本“14+16”,我似乎找不到类似的在线任务,当单击链接时,查询字符串用于分配问题旁边的文本以完成答案 使用PHP实现这一目标的好方法有哪些?我几天前才开始学习基础知识 <p>The link below comes back to this same page, with a querystring added to the URL.</p> <p>Finish the question (answer only appears when yo

链接应用于文本“14+16”,我似乎找不到类似的在线任务,当单击链接时,查询字符串用于分配问题旁边的文本以完成答案

使用PHP实现这一目标的好方法有哪些?我几天前才开始学习基础知识

<p>The link below comes back to this same page, with a querystring added to the URL.</p>

<p>Finish the question (answer only appears when you click on the link):</p>

<p><a href="?n1=14&n2=16">14 + 16 = 

<?php



?>

</a></p>
下面的链接返回到同一页面,URL中添加了一个查询字符串

完成问题(答案仅在单击链接时显示):


似乎完成了我所需要的。如果有人有任何其他方法,我很想学习/看看。

$\u GET['n1']+$\u GET['n2']
也许吧?那么,当用户单击页面时,是否要用计算结果更新页面?这听起来像是客户端Javascript的任务,而不是任何服务器端语言。。。但是我需要使用php来完成这个任务。user3783243在我需要做的事情上可能是正确的
echo htmlspecialchars($_GET["n1"])  +  $_GET['n2'];