首页 > 解决方案 > Wordpress:找不到 PHP 脚本 HTTP 404 错误

问题描述

我目前的任务是在 WordPress 上创建一个完整的主题。这就是登录系统。现在,我已经创建了表单,一切看起来都很好,问题是 wordpress 与我争吵并且无法找到我的注册脚本,它会创建一个 HTTP 404 错误。现在我认为这与 wordpress 永久链接系统有关,因为它想要找到一个页面,而不是我的signup.inc.php脚本。

现在这让我感到沮丧,因为我对编码有点陌生,我不知道如何解决它!

这是我的代码链接到位于名为“包含”的文件夹中的实际文件

  <form action='includes/signup.inc.php' method="post">
      <div class="form-group">
        <label for="Username">Username</label>
        <input type="text" class="form-control" name="uid" id="uid" placeholder="Username" required>
        <small id="userhelp" class="form-text text-muted">This name will show on forums and the socialpage.</small>
      </div>

      <div class="form-group">
        <label for="firstname">Firstname</label>
        <input type="text" class="form-control" name="firstname" id="firstn" placeholder="Firstname" required>
      </div>

      <div class="form-group">
        <label for="lastname">Lastname</label>
        <input type="text" class="form-control" name="lastname" id="lastn" placeholder="Lastname" required>
      </div>
      <div class="form-group">
      <label for="email">Email Adress</label>
      <input type="email" class="form-control" name="mail" id="inputemail" aria-describedby="emailHelp" placeholder="Email" required>
      <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
      </div>

      <div class="form-group">
        <label for="password">Password</label>
        <input type="password" class="form-control" name="pwd" id="password" placeholder="Password" required>
      </div>

      <div class="form-group ">
        <label for="password">Repeat password</label>
        <input type="password" class="form-control" name="pwd-repeat" id="password" placeholder=" Repeat password" required>
        <small id="passHelp" class="form-text text-muted">Please retype your password.</small>
      </div>

  <div class="form-group">
    <div class="form-check">
      <input class="form-check-input" type="checkbox" id="invalidCheck3" required>
      <label class="form-check-label" for="invalidCheck3">Agree to terms and conditions</label>
      <div class="invalid-feedback">
        You must agree before submitting.
      </div>
    </div>
  </div>
      <button class="btn btn-dark" name="signup-submit" type="submit">Signup</button>
    </form>

标签: phpwordpressauthenticationaction

解决方案


请在表单中使用此操作:

<form action='<?php echo get_template_directory_uri(); ?>/includes/signup.inc.php' method="post">

推荐阅读