简体   繁体   English

php登录页面; 按号码登录后重定向到用户页面

[英]Php login page; redirect after logging in by number to user page

I want to have php page, where you input a six-digit number into textbox and you press button.我想要一个 php 页面,你在文本框中输入一个六位数的数字,然后按下按钮。 After that it will redirect you to "/ that number you put in .html".之后,它会将您重定向到“/您放入.html 中的那个数字”。 I had something like this before, but I can't remember how to do that.我以前有过这样的事情,但我不记得怎么做。

Thanks for answers感谢您的回答

<?php

if(isset($_GET["sixdigit"])){
    header('Location: '. "URL/".$_GET["sixdigit"]);
}


?>


<form>
  6-digits<br>
  <input type="text" name="sixdigit">

  <br><br>
  <input type="submit" value="Submit">
</form> 

you mentioned redirect.你提到了重定向。 Are you referring to a search-like box that will redirect to another .html page?您是指将重定向到另一个 .html 页面的类似搜索的框吗?

If so, you can redirect this way in your .php page.如果是这样,您可以在 .php 页面中以这种方式重定向。

header("Location: ../index.php?login=empty");

Depending where you want to redirect specifically, you could try根据您要具体重定向的位置,您可以尝试

header("Location: ../123456.html"); header("位置:../123456.html"); I would like to ask, what kind of application is are working on?我想问一下,正在开发什么样的应用程序?

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

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