如何将提交的值从设置.php回显到主页.php


How do I echo submitted values from settings.php to mainpage.php?

我基本上是在尝试获取从设置中提交的值,以便当用户提交它时,它会显示在主页上.php。这是我在设置中的代码.php...

<html>
<head><title></title></head>
<body>
<a href="logout.php">Logout</a>
<a href="mainpage.php">Main Page</a>
<form action="" method="get">
<b>Bio</b>
<br>
<textarea rows="5" cols="20" name="result" value="result"></textarea>
<br>
<input type="submit" value="Submit" name="bio">
</form>
<form action="" method="get">
<b>Hobbies</b>
<br>
<textarea rows="5" cols="20" name="result" value="result"></textarea>
<br>
<input type="submit" value="Submit" name="hobbies">
</form>
<form action="" method="get">
<b>Past School</b>
<br>
<textarea rows="5" cols="20" name="result" value="result"></textarea>
<br>
<input type="submit" value="Submit" name="school">
</form>
<form action="" method="get">
<b>Work History</b>
<br>
<textarea rows="5" cols="20" name="result" value="result"></textarea>
<br>
<input type="submit" value="Submit" name="work">
</form>
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Choose Profile Picture:</label>
<input type="file" name="file" id="file"> 
<input type="submit" name="pic" value="Submit">
</form>
</body>
</html>

这就是我对主页的.php

<?php
?>
<html>
<head><title></title></head>
<body>
<a href="logout.php">Logout</a>
<a href="settings.php">Settings</a>

</body>
</html>

有什么建议吗?

正如Jenna R所说,最好使用POST,而不是GET。

然后每个变量都引用 $_POST["name"] ,所以$_POST["result"]等等。

我建议你开始阅读PHP并安全地提交表单,如果你这样做是为了学习以外的任何事情。 这是非常基本的,所以看起来你还没有打开手册或一本书。