when I visit mainpage.php without going to settings, my page gives me the undefined variable error for all the variables, but when I input something in the settings and submit, it doesnt show anymore. Anyways, here's the code so far.
Mainpage.php
<html>
<head><title></title></head>
<body>
<a href="logout.php">Logout</a>
<a href="settings.php">Settings</a>
</form>
</body>
</html>
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$bio = $_POST['bio'];
$hobbies = $_POST['hobbies'];
$past = $_POST['past'];
$work = $_POST['work'];
echo $bio;
echo $email;
echo $name;
echo $hobbies;
echo $past;
echo $work;
?>
settings.php
<html>
<head><title></title></head>
<body>
<a href="logout.php">Logout</a>
<a href="mainpage.php">Main Page</a>
<form action="mainpage.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
Bio: <input type="text" name="bio"><br>
Hobbies: <input type="text" name="hobbies"><br>
Past School: <input type="text" name="past"><br>
Work History: <input type="text" name="work"><br>
<input type="submit">
</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>
I can't seem to find out how to get rid of the undefined error. Someone suggested isset I believe.