Auto pairing of old registered members in a database with new sign-ups

i want to know how i will automatcally match up new sign-ups to pay old members in the database(selection of old members to be paid could be random or controlled by the admin) in a dynamic website

Welcome to the forums, @seanjoe45. You are more likely to get help if you show us what you have done so far. For example, how is your database structured (show us the relevant table schemas) and what attempts have you made to match the sign-ups (please post your code)? We are happy to give you a hand with this, but we don’t really want to do all your work for you.

this whole “pay old members by new members database selection” makes absolutely no sense for me. thats at least three different tasks.

public function payOldMembersByNewMemebers(){
	// put code here
}

ok I want to build a peer to peer donation website, I’m through with the registration form and the database but I don’t know how to go about the login script preparation(e.g. the dashboard, confirmation of payment, pairing of individuals to the benefactor, details of the benefactor being displayed on the dashboard of the help giver, automation of this processes etc.) kevin yank book on practical php and MySQL has been of immense help,but he didn’t go further to address this areas I have mentioned

Well, the way to do it is break things down into simple steps and attack each one at a time. For example a login script is really nothing more than asking for username and password, checking they are correct, then displaying the appropriate screen which by the sound of it is a “dashboard” screen. From there, you can select benefactors, choose amounts to pay, and so on.

<!doctype html>
<html lang=en>
<head>
<title>The Login page</title>
<meta charset=utf-8>
<link rel="stylesheet" type="text/css" href="includes.css">
</head>
<body>
<div id="container">
<?php include("includes/login-header.php"); ?>
<?php include("includes/nav.php"); ?>
<?php include("includes/info-col.php"); ?>
<div id="content"><!-- Start of the login page content. -->
<?php 
// This section processes submissions from the login form
// Check if the form has been submitted
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    //connect to database
    require ('mysqli_connect.php');
    // Validate the email address
    if (!empty($_POST['email'])) {
            $e = mysqli_real_escape_string($dbcon, $_POST['email']);
    } else {
    $e = FALSE;
        echo '<p class="error">You forgot to enter your email address.</p>';
    }
    // Validate the password
    if (!empty($_POST['psword'])) {
            $p = mysqli_real_escape_string($dbcon, $_POST['psword']);
    } else {
    $p = FALSE;
        echo '<p class="error">You forgot to enter your password.</p>';
    }
    if ($e && $p){//if no problems
// Retrieve the user_id, first_name and user_level for that email/password combination
        $q = "SELECT user_id, fname, user_level FROM users WHERE (email='$e' AND psword=SHA1('$p'))";        
        $result = mysqli_query ($dbcon, $q); 
        // Check the result
        if (@mysqli_num_rows($result) == 1) {//The user input matched the database rcoord
// Start the session, fetch the record and insert the three values in an array
        session_start();
        $_SESSION = mysqli_fetch_array ($result, MYSQLI_ASSOC);
$_SESSION['user_level'] = (int) $_SESSION['user_level']; // Changes the 1 or 2 user level to an integer
$url = ($_SESSION['user_level'] === 1) ? 'admin-page.php' : 'members-page.php'; // Ternary operation to set the URL
header('Location: ' . $url); // Sends the user to one of the pages. The $url is a relative path
exit(); // Cancels the rest of the script
    mysqli_free_result($result);
    mysqli_close($dbcon);
    } else { // No match was made
    echo '<p class="error">The email address and password entered do not match our records.<br>Perhaps you need to register, click the Register button on the header menu</p>';
    }
    } else { // If there was a problem
        echo '<p class="error">Please try again.</p>';
    }
    mysqli_close($dbcon);
    } // End of SUBMIT conditional
?>
<!-- Display the form fields-->
<div id="loginfields">
<?php include  ('includes/login_page.inc.php'); ?>
</div>
<br>
<?php include ('includes/footer.php'); ?>
</div>
</div>    
</body>
</html>
<h2>Login</h2>
<form action="login.php" method="post">
    <p><label class="label" for="email">Email Address:</label>
    <input id="email" type="text" name="email" size="30" maxlength="60" value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" > </p>
        <p><label class="label" for="psword">Password:</label>
    <input id="psword" type="password" name="psword" size="12" maxlength="12" value="<?php if (isset($_POST['psword'])) echo $_POST['psword']; ?>" ><span>&nbsp;Between 8 and 12 characters.</span></p>
    <p><input id="submit" type="submit" name="submit" value="Login"></p>
</form><br>

ok I want to build a peer to peer donation website, I’m through with the
registration form and the database but I don’t know how to go about the
login script preparation(e.g. the dashboard, confirmation of payment,
pairing of individuals to the benefactor, details of the benefactor
being displayed on the dashboard of the help giver, automation of this
processes etc.) kevin yank book on practical php and MySQL has been of
immense help,but he didn’t go further to address this areas I have
mentioned

also another new problem i encountered is that after the login a blank page including just the header appears(in the web server),whereas in my local MAMP server the login page is not blank

this the error log,but i dont know how to solve the problem-
[24-Mar-2017 20:19:43 UTC] PHP Warning: include(includes/login_page.inc.php): failed to open stream: No such file or directory in /home/expressc/public_html/login.php on line 60
[24-Mar-2017 20:19:43 UTC] PHP Warning: include(includes/login_page.inc.php): failed to open stream: No such file or directory in /home/expressc/public_html/login.php on line 60
[24-Mar-2017 20:19:43 UTC] PHP Warning: include(): Failed opening ‘includes/login_page.inc.php’ for inclusion (include_path=‘.:/opt/cpanel/ea-php56/root/usr/share/pear’) in /home/expressc/public_html/login.php on line 60

"no such file or directory" error can be resolved by creating the expected file, or changing the path to an existing file. you may also check filesystem access rights.

it shows in my local MAMP server,but refuses to show online

Is it possible that your server has a case-sensitive file system, and one or more of your files has been uploaded in a way that’s different than the PHP code suggests? I’m not sure whether the server software would ignore something like that.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.