Jump to content

Burton

Members
  • Posts

    2
  • Joined

  • Last visited

About Burton

  • Birthday 03/16/1995

Previous Fields

  • Languages
    HTML, PHP, CSS, C++

Profile Information

  • Location
    Lexington

Burton's Achievements

Newbie

Newbie (1/7)

1

Reputation

  1. You could start out with an if statement to see if the user exists on a separate page then another if to check for the user... then something like this $validate = new Validate(); $validation = $validate->check($_POST, array( 'username' => array( 'required' => true, 'min' => 0, /* Whatever you have as the mininum for a username */ 'max' => 0, /* Whatever you have as the max */ 'unique' => 'users' ), & so on with password and whatever else.... It'd be similar to this so watch tutorials on if statements and arrays if you're not already good with them EDIT: Sorry I thought you was talking about a register page, the login page would be similar without the DB info you made with min and max letters/numbers
  2. I want to update users when they purchase premium by their email OR database ID, either one would work, BUT the only way it's working for me at the moment is by me entering their ID in the $_SESSION at the top. I want the page to get the users ID OR email after they purchase. I have asked this many places and have got no answer, people basically tell me to just type it. That would be crazy to do that for every single user. If you have an answer, PLEASE! I literally beg for you to copy the code above and place stuff where it needs to be, I've been stuck for days/weeks. I've tried EVERYTHING, except the right thing. Nothing is working for me on this, I also can't find anything on Google about it. I'm not an expert with PHP, so I may be missing bits, if I am, feel free to tell me I'm doing it wrong and let me know what I need to do. <?phprequire_once ('vendor/autoload.php');$_SESSION['user_id'] = '?';$stripe = array( "secret_key" => "sk_test_vDYOBYxCErhrgGCeWQJhR4mQ", "publishable_key" => "pk_test_4mIuE3OsajKO4cnFppcDDISu" ); StripeStripe::setApiKey($stripe['secret_key']);$db = new PDO('mysql:host=127.0.0.1;dbname=blog', 'root', '');$userQuery = $db->prepare(" SELECT id, username, email, premium FROM users WHERE id = id "); $userQuery->execute(['user_id' => $_SESSION['user_id']]); $users = $userQuery->fetchObject();
×
×
  • Create New...