Jump to content

Bird

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Bird

  • Rank
    Newbie
  1. Bird

    FOR LOOP not working

    You're absolutely right. I'm very new at this and thought I had to use a loop for an array. Realized I was already returning the row when I set the $_SESSION['user']. // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } else{ echo 'Connected! '; $sql = "SELECT * FROM KJE WHERE username = '$user' AND password = '$pass' "; $result = mysqli_query($conn,$sql); $check = mysqli_fetch_array($result); $_SESSION['currency'] = $check['currency']; $_SESSION['level'] = $check['level']; ^much better
  2. Bird

    FOR LOOP not working

    Both of these are using the same DB connection($conn) and both currency and level are in the table, yet when I run my page, it shows currency, but level comes up blank. // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } else{ echo 'Connected! '; $sql = "SELECT * FROM KJE WHERE username = '$user' AND password = '$pass' "; $result = mysqli_query($conn,$sql); $check = mysqli_fetch_array($result); if(isset($check)){ $_SESSION['username'] = $user; //BELOW WAS WORKING. WHILE TROUBLESHOOTING I CHANGED IT. WHEN I CTRL+Z BACK TO
  3. Got it working! Not sure what I did differently from earlier(I took post out while troubleshooting)... Probably just being a dumby. Thanks a ton
  4. Hello! I know there are a lot of posts on the internet about this but I can't find one that solves my problem. I'm following the PHP Login Page tutorial on w3schools.com and am having some trouble. https://www.w3schools.com/howto/howto_css_login_form.asp It is not passing the 'uname' and 'psw' to action_page.php. Not sure why... Everything looks referenced correctly I have 2 scripts here: 1) index.html(This seems to be working as-far as sending the credentials to action_page.php, I see the URL at the top is to action_page.php and includes the input u
×
×
  • Create New...