Help - Search - Members - Calendar
Full Version: Admin Section
Weborum Webmaster Forum > Web Page Design > PHP
Waleed
http://www.joe2torials.com/php/php_admin_section.php

I needed to make a login thing for a project I'm doing and I found you Admin Section tut while searching for appropriate stuff...anyway, I tried it, made the .php pages, the database and everything but I have two problems.

CODE

else {
  header('Location: http://www.blah.com/login.php?error=1');
  exit(); }
?>


if the login information is incorrect, the browser takes me to a blank page with that URL in the address bar. shouldn't it display the error message we set in the page with the login form?

The other, much bigger problem is because of my lack of php/mysql knowledge, I think. What are the passwords that let me log in, and how can I change/set them? Are they set when we created the table 'login', or do we set them ourselves somehow, later?

regards and TIA,
Waleed Zuberi. the learning PHPician
Joe
You have to add the username and password yourself. I left it blank so users could maybe add encryption to the form if they wanted to.

Correct, when error is set you should be taken back to the forum with;

PHP
<?php
if (isset($_GET['error'])) {
  echo
'Invalid login data supplied. Please try again.';
}
?>


Is that not whats happening? Or is it because no users exist in the database at the moment?

I must admit, but it's not the most advanced of codes. I should really write a more updated version.
Waleed
but how do I add a username and password?
I just need two logins at the moment....
Waleed
problem solved. I inserted usernames and passords into 'login' and it worked. thanks for the script and the help joe biggrin.gif
Joe
If you'd like to add encryption aswell I can help you get that set up.

Glad you got it working smile.gif
Waleed
encryption?

no, I don't think I need to go that far...thanks again biggrin.gif
cmj-php
Hi joe2kiss, please could I have help on encryption. Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.