Grizzley g
New member
I guess that is on incomplete question. What I'm trying to do is define a value for $user and a value for $password.
After that, I have an html form on that page which asks me to submit a user and a pass.
The function I have setup is as such: if($submit && $uservalidate==$user && $passvalidate==$pass) {echo "Welcome, admin!";}
Where
$uservalidate = (isset($_POST["user"])) ?$_POST["user"]:"";
$passvalidate = (isset($_POST["password"])) ?$_POST["password"]:"";
$submit = (isset($_POST["submit"])) ?$_POST["submit"]:"";
without the spaces.
Now everything is working fine. If I have the right combination, it shows me "Welcome admin!" and if not successful, it shows me nothing. Which is, so far, correct.
But here's the problem: I'm using that page as a central for all administrative tasks, like looking at all the people who have signed up from a particular database, looking at how many wishes there are from another database, and how many times the pages have been visited from yet another databases which deals with ip count.
However, I only wish to see those things if and only if the combination are correct. If they're not correct, then the page should simply ask for the combination again.
So, is there a way in which I can show the html only if the combination is right? One way to go about this is to have the entire html information "echo" through PHP, but I wish to maintain two distinct sections, and I wish to have html within html tags.
Any ideas will truly be helpful. This is not a must; and in the end, I'm probably going to use a database, but is there a way in which this could be achieved?
Two distinct sections meaning a php part and an html part.
After that, I have an html form on that page which asks me to submit a user and a pass.
The function I have setup is as such: if($submit && $uservalidate==$user && $passvalidate==$pass) {echo "Welcome, admin!";}
Where
$uservalidate = (isset($_POST["user"])) ?$_POST["user"]:"";
$passvalidate = (isset($_POST["password"])) ?$_POST["password"]:"";
$submit = (isset($_POST["submit"])) ?$_POST["submit"]:"";
without the spaces.
Now everything is working fine. If I have the right combination, it shows me "Welcome admin!" and if not successful, it shows me nothing. Which is, so far, correct.
But here's the problem: I'm using that page as a central for all administrative tasks, like looking at all the people who have signed up from a particular database, looking at how many wishes there are from another database, and how many times the pages have been visited from yet another databases which deals with ip count.
However, I only wish to see those things if and only if the combination are correct. If they're not correct, then the page should simply ask for the combination again.
So, is there a way in which I can show the html only if the combination is right? One way to go about this is to have the entire html information "echo" through PHP, but I wish to maintain two distinct sections, and I wish to have html within html tags.
Any ideas will truly be helpful. This is not a must; and in the end, I'm probably going to use a database, but is there a way in which this could be achieved?
Two distinct sections meaning a php part and an html part.