search

Home  >  Q&A  >  body text

Submit the form, the jump is unsuccessful, 404. Do you want to ask where the configuration error is? Beginners using PhpStorm without configuration

form.html:
<html>
<head>
    <meta charset="utf-8">
    <title>php中文网(php.cn)</title>
</head>
<body>
<form action="welcome.php" method="post">
    名字: <input type="text" name="fname">
    年龄: <input type="text" name="age">
    <input type="submit" value="提交">
</form>
</body>
</html>

welcome.php

Welcome<?php echo $_POST["fname"]; ?>!<br>
Your age is<?php echo $_POST[ "age"]; ?> years old.

400°眼镜的沙子400°眼镜的沙子1961 days ago1123

reply all(4)I'll reply

  • 王林

    王林2019-08-20 17:51:55

    Another issue that needs attention is that when opening form.html, you must open it by entering the URL, otherwise welcome.php will be displayed as a pure code page

    reply
    0
  • 400°眼镜的沙子

    http://localhost/Projects/welcome.php The requested URL /Projects/welcome.php was not found on this server. Apache/2.4.23 (Win64) PHP/7.0.10 Server at localhost Port 80 The page probably looks like this

    400°眼镜的沙子 · 2019-08-23 17:29:28
  • kanglecheng

    kanglecheng2019-07-19 14:41:15

    The two files must be in the same directory, such as
    page/form.html
    page/welcome.php

    reply
    0
  • 400°眼镜的沙子

    in a folder

    400°眼镜的沙子 · 2019-08-23 17:10:01
  • Cancelreply