php - 从 PHP 中的 URL id 跳转到页面部分
问题描述
我正在为一个 QA 论坛工作。我有一个问题并进行了搜索,但没有找到更好的解决方案。在登录系统中,我得到了 redirect_to URL 之类的 -
http://localhost:8081/qa/506/how-to-connect-the-html-page-to-the-mysql-database-using-php#ans123
这是我登录后将使用的。我知道,我可以使用
<a name="ans123"></a>
to jump section 或 by id 。
我正在从 URL 中获取价值,例如 -
login.php?redirect_to=http://localhost:8081/qa/506/how-to-connect-the-html-page-to-the-mysql-database-using-php#ans123
redirect_to=$_GET['redirect_to'];
但它只给了我http://localhost:8081/qa/506/how-to-connect-the-html-page-to-the-mysql-database-using-php
不是
http://localhost:8081/qa/506/how-to-connect-the-html-page-to-the-mysql-database-using-php#ans123
与 #ans123 。
我想在登录问题页面后将用户跳转到 textarea。
我在底部有一个 textarea,名称为“textarea”
<a name="ans123"> </a>
<form action="#" method="POST">
<textarea name="anscontent" required></textarea>
<script>
CKEDITOR.replace("anscontent", {
height: 300,
filebrowserUploadUrl: "upload.php",
});
</script>
<button name="answer_submit">Post your Answer</button>
</form>
还有一件事,我见过一种方法
http://localhost:8081/qa/506/how-to-connect-the-html-page-to-the-mysql-database-using-php?state=ans-890 .
如果我打开这个 URL,它会打开 textarea。
- 登录后如何跳转到Textarea框区域(底部HTML文本编辑器)
- 我该如何编辑答案。如果用户单击编辑按钮或链接,则跳转到文本框并编辑数据。提交编辑后跳转到更新的答案。
解决方案
推荐阅读
- mongodb - 有没有办法过滤 mongodb 中的嵌入式数组?
- java - Java NIO 套接字:服务器没有通过同一个套接字接收第二条消息
- django - 从表格中保存一些信息,例如状态,城市,图像
- string - 计算数据框行中值 A 存在的次数、值 B 的次数以及值 A 和 B 的次数
- javascript - Web Animations API - 设置关键帧?
- wordpress - Wordpress 存储要在帖子中使用的表格数据的最佳方式
- php - 防止codeigniter sql中重复数据输出
- postgresql - Posgresql - 没有子查询的 jsonb 对象减少
- facebook - Facebook Graph API - 两级应用权限
- javascript - 使用反应得到错误 this.node(...) is null?