[英]how to redirect from a form to different page?
I would like to add a form in my page. 我想在我的页面中添加一个表单。 When I click on the submit button it post some details.
当我点击提交按钮时,它会发布一些细节。
<form action="http://toggletime.net/redirect.php" method="get">
<input type="text" name="url" />
<button type="submit">Search</button></form>
I can use GET
or POST
. 我可以使用
GET
或POST
。 But my problem is I want to create diffrent page for each POST
or GET
. 但我的问题是我想为每个
POST
或GET
创建不同的页面。
The actual URL will be like: http://toggletime.net/redirect.php?url=text
实际的URL将如下:
http://toggletime.net/redirect.php?url=text
: http://toggletime.net/redirect.php?url=text
url http://toggletime.net/redirect.php?url=text
I want to redirect it to: http://toggletime.net/text
我想将其重定向到:
http://toggletime.net/text
: http://toggletime.net/text
How can I do that? 我怎样才能做到这一点?
In redirect.php
do this: 在
redirect.php
执行以下操作:
if (isset($_GET['url']) && !empty($_GET['url'])) {
header("Location: {$_GET['url']}");
exit;
}
Isn't this what you want? 这不是你想要的吗?
but here my problem in no such page like that. 但在这里我的问题没有这样的页面。 The page is not found.
找不到该页面。
HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. HTTP错误404.0 - 未找到您要查找的资源已被删除,名称已更改或暂时不可用。
how can i create page dynamically during each search? 如何在每次搜索期间动态创建页面? or is there any other way to solve it?
或者还有其他方法可以解决吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.