Hi everyone!

I'm the webmaster for the College Place Fire Department, and I would like to know how to set up a secure log-in on the site for our members.

Here is the site URL-

http://www.ci.college-place.wa.us/FireDept/home.html

The Training Officer would like me to set up a log-in for our department members on the 'Training' page. This would lead to training options and general information that the public is not privy to.

Here's my background in web design- I've taken a number of classes in web design, such as HTML classes and Graphics design classes. I'm currently learning Dreamweaver MX, as up to this point all of my HTML coding has been done by hand on the seven sites that I administer (not just the CPFD page).

So, knowing nothing about this PHP stuff, is there a program out there that I can obtain, that I can upload to the server that hosts our site, that will enable me to set all this up?

My only experience with PHP to this point, is when I set up a discussion board on another website that I administer. Here's the link to the board-

http://scalefirebombers.com//forum/

This was a package that I simply added to my site, and I was able to go in and set up the features I wanted. I would like to know if there is a similar program out there that will enable me to do the same basic thing for a secure log-in for our website.

I don't think we need a "https" site for this. Just something that only our members can get to.

Any help you guys can give me is very appreciated. Anyone who can get me going in the direction I need, will be thanked on the site once I get it up and going. Also, sorry to be so long-winded in this message.

Thanks everyone! 🙂

Best regards,

Dan

(a.k.a. "The total newbie")

    have you searched google for php login scripts? i get nearly 3 million hits.

      Hey,
      I am a noob as well, but I have found a relitivley easy script to use, and it requires no knowledge of mysql whatsoever. All you have to do is know how to link with it.
      here it is:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      <HTML>
      <HEAD>
      <TITLE>Login</TITLE>
      <!--
      Written By: Nicholas Tseles
      1/25/2005
      -->
      </HEAD>
      <BODY bgcolor="#000000" text="red">
      <!--
      The following javascript function will act as our error page
      -->
      <script language="javascript">
      function error()
      {
      document.write("<br><br><br><body bgcolor='black' text='red' link='purple' alink='purple' vlink='purple'><center>Unable to confirm password!<br><br><a href='index.php'><h4>Back</h4></a></center></body>");
      }

      //This function will make sure the text box is not empty
      function check()
      {
      if(form1.pass.value == ""){error();}
      }
      </script>

      <center>
      <br><br><br>

      <center><form name="form1" method="post" action="check1.php">
      Username<input type="username" name="user" size="15"><br><br>

      Password<input type="password" name="pass" size="15"><br><br>
      <form name="form1" method="post" action="check.php"><br />
      <input type="submit" name="submit" value="Enter" onclick="check()">
      </center
      </form>
      <br><br><br>
      If your password fails<br>
      your IP will be logged as<br>

      <!-- The following php code just scares people by showing them their
      ip, you dont really have to log it.
      -->
      <?php
      $ip = $_SERVER['REMOTE_ADDR'];
      echo $ip;
      ?>

      </center>
      </BODY>
      </HTML>

      after yu implement this script, all you have to do is have 2 docs named check and check 1 both .php
      here is the code for them:

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      <HTML>
      <HEAD>
      <TITLE>Login</TITLE>
      </HEAD>
      <!--
      Written By:Nicholas Tseles
      1/25/05
      -->
      <BODY>

      <?php

      $password=$POST['pass']; //Gets the password from previous page entry
      $fp=fopen("pass.txt","r"); //Opens the Pass.txt file
      $data=fgets($fp); //Reads the File entirely
      fclose($fp); //Closes the file since we already got our info
      if($password == $data) //compare passwords
      {
      echo "Password Accepted"; //Here is where you will set your path for entry
      }
      else
      {
      echo "<br><br><br><body bgcolor='black' text='red' link='purple' alink='purple' vlink='purple'><center>Unable to confirm password!<br><br><a href='index.php'><h4>Back</h4></a></center></body>";
      }
      $username=$
      POST['user']; //Gets the password from previous page entry
      $fp=fopen("username.txt","r"); //Opens the Pass.txt file
      $data=fgets($fp); //Reads the File entirely
      fclose($fp); //Closes the file since we already got our info
      if($username == $data) //compare passwords
      {
      echo "<br>Username Accepted"; //Here is where you will set your path for entry
      }
      else
      {
      echo "<br><br><br><body bgcolor='black' text='red' link='purple' alink='purple' vlink='purple'><center>Unable to confirm username!<br><br><a href='index.php'><h4>Back</h4></a></center></body>";
      }

      ?>

      </BODY>
      </HTML>

      then as a data base, all you have to do is make 2 text files and save them as
      pass.txt-which will have all your passwords
      username.txt-which will have all your usernames
      this way they are stored offsite
      all you do is stick them in the same web folder as your site
      Do not forget to set your path of entry on the check pages to redirect you to the html page
      good luck!
      p.s.
      remember that i am a noob too so take my ideas with extreme caution
      wOOt

        what exactly do you mean is a there a program you can upload? Do you mean that PHP is not installed on your server? Do you have access to the server? are you running Apache? Could you give a little more info please? then maybe we can help you 😮)

          It would probably be easier to create a secure directory using .htaccess to password protect it.

          Have a look at your server's control panel, if you have one, to see if that facility exists.
          If not, this link .

          Then you wouldn't have to do any php, or mysql stuff.
          Dreamweaver (mx2004) has a tutorial in the help files for 'user authentication' - took me about an hour to work through it (eventually!)

            I would like to switch to the .htaccess files from my crude php script earlier...
            how do I database all the names? and passwords?
            Thanks!
            And how would I have people register and also redirect authenticated to a members page, and non authenticated to a please login page?

              or should I just use this .htaccess as a register function and use my php script to login? thanks!

                Write a Reply...