hello,
im trying to create a simple bank using php and sql, i need some help doing money transfer between users inside the database, so basically changing values within the database using an html input form. i need some help since i cant quite figure how it should look. here’s my code:
> <?php
> include('config.php');
> ?>
> <?php
> // Initialize the session
> session_start();
>
> // Check if the user is logged in, if not then redirect him to login page
> if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
> header("location: login.php");
> exit;
> }
> ?>
>
>
> <!DOCTYPE html>
> <html lang="en">
> <head>
> <meta charset="UTF-8">
> <title>Welcome</title>
> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.css">
> <style type="text/css">
> body{ font: 14px sans-serif; text-align: center; }
> </style>
> </head>
> <body>
> <div class="page-header">
> <h1>Hi, <b><?php echo htmlspecialchars($_SESSION["username"]); ?></b>. Welcome to our site.</h1>
> </div>
> <p>
> <a href="reset-password.php" class="btn btn-warning">Reset Your Password</a>
> <a href="logout.php" class="btn btn-danger">Sign Out of Your Account</a>
> </p>
> </body>
> </html>
>
>
>
>
>
> <form action="changeinfo.php" method="post">
> Change Username: <input type="text" name="username"><br/>
> Change Password: <input type="text" name="password"><br/>
> <input type="submit" value="Submit">
>
> </form>
>
>
>
> <h1>Transfer Money</h1>
> <form action="transfer.php" method="post">
> ID: <input type="text" name = "field1" /><br/>
> Amount: <input type="text" name = "field2" /><br/>
>
>
> <input type="submit" value="Send Money" />
> </form>