Hello all,
I have been teaching myself PHP through others writting; so bear with me if you find something foolish.
Having said so, I want to make a simple Music library with MySQL/PHP. I have made this very simple Login form as shown below. I want after someone successful login be redirected where he can populate things in Library. The he should be able to see it via another PHP file. Here are my Questions:
1. How do I redirect a page after successful login?
2. How do I make a dynamic table that I can alter its cells anytime? I mean when one adds his music the PHP file should print the table with cells full of all info.
3. Supplemently, can one recommend tutorial that can help me to achieve what I have said?
Thanks all :)
// This is login.php
<html>
<head>
<title> Login</title>
</head>
<body>
<form action ="login.php" method = "post" >
<p> User name
<input type = "text" name = "user" />
</p>
<p> Password
<input type = "password" name = "pass" />
<input type = "submit" value = "Go" />
</p>
</form>
<?php
$user = $_POST["user"];
$pass = $_POST["pass"];
if (($user=="elijah")&&($pass=="jesus" )) echo "Access provided, Enjoy $user !";
else echo "Access denied, please $user contact your system Admin ";
?>
</body>
</html>
Here is the fill in form
//fill_in.php
<form action="/projects/LearningPHP/include/inc.get_results.php" method="post" >
<p>Year:</p>
<p><input type="text" name="album_year" /></p>
<p>Album:</p>
<p><input type="text" name="album_name" /></p>
<p>Artist:</p>
<p><input type="text" name="album_artist" /></p>
<p>Owner:</p>
<p><input type="text" name="album_owner" />
<p><input type="submit" value="Send" />
</p>
</form>
Here is the inc.get_result.php
//inc.get_result.php
<?php
$album_year = $_POST["album_year"];
$album_name = $_POST["album_name"];
$album_artist = $_POST["album_artist"];
$album_owner = $_POST["album_owner"];
foreach($_POST as $key=>$value){
//print $key;
// I have failed to display the data in table
}
?>