Jump to content

omega1983

New Members
  • Posts

    2
  • Joined

  • Last visited

omega1983's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php //check for required fields from the form if ((!$_POST['username']) || (!$_POST['password'])) { header("Location: auth1.php"); //header("Location: auth1.php"); exit; //set authorization cookie $servername = "localhost"; $username = "tmc_user50"; $password = "Atl_344"; // Create connection $conn = mysqli_connect($servername, $username, $password); $message=""; if(count($_POST)>0) { $conn = mysqli_connect("localhost","tmc_user50","Atl_344"); $result = mysqli_query($conn,"SELECT * FROM admin2 WHERE username='" . $_POST["username"] . "' and password = '". $_POST["password"]."'"); $count = mysqli_num_rows($result); if($count==0) { $message = "Invalid Username or Password!"; } else { $message = "You are successfully authenticated!"; } } } ?> When I enter any username ad password the code from auth2.php (the code above allows a connection anyway) I am attempting to redirect users back to auth1 if there is an incorrect username or password
  2. I have an html form that allows user to enter data. Data type for the most part is text. I want to have a drop down to allow people to choose and have it populate a database. In the database I have golfer_1 golfer_2 golfer_3 How can I create the drop down so that php will populate base on the choice made by customer and have it populate the database. I am ok with the populating based on text
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.