This is an extremely basic question and I feel silly asking.
I wrote a basic php login script but I’ve never ran it until today only researched php, how to use it, etc.
The code is a basic login script and I can’t seem to even open it in a browser to see if I did it right and debug it
[php]<?php
include(“config.php”);
// Check form if is submited
if(isSet($_POST[‘trimite’])) {
// Check if user is equal with username and password from config.php
if($_POST[‘user’] != $user || $_POST[‘pass’] != $pass) {
echo “Sorry, your data is invalid”;
} else {
// Open the session for store user logged
session_start();
// Setting the session
$_SESSION[‘logat’] = “da”;
// Redirecting user to admin page if is logged
Header(‘Location: admin.php’);
}
} else {
// Form
echo ’
Username:
Password:
?>[/php]
I thought I finally grasped it and then came across this and it’s making me feel dumb. All it shows up as in my folder is a Notepad. Maybe I need to go back to the basics? I don’t know. If someone could help it would be an immense favor. Thank you.