A user-accessible address book using php?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • truckmen

    #1

    A user-accessible address book using php?


    Hello All,


    I still can't figure it all out.

    I am trying to create a web page (using php) where:

    1) A visitor add his or her name to an address book that can also be
    viewed online by other visitors to the website.

    In creating this, I will also need to:

    2) Allow that visitor to create a username and password to add his/her
    information.

    3) Allow that visitor to make changes and updates to his or her entry in
    future visits to the website.

    and...

    4) Create an automated system for that user to retreive his/her username
    and/or password if s/he has forgotten it.

    Boy oh boy, would I be happy just to be able to make step #1 a reality.
    Can anyone please help me with this? I am leasing space from Aitcom and my
    server is a Linux system. I have MySQL and PHP available to work with.


    I have an example in mind. The following website is another school very
    similar to ours in Maine, and they have a system in place almost exactly
    as I'd like to create:

    http://www.mmaaa.org/:)

    Most Sincerely,
    Ralph M Bohm
    Maine Maritime Academy


  • Scott Orsburn

    #2
    Re: A user-accessible address book using php?

    truckmen wrote:
    [color=blue]
    >I am trying to create a web page (using php) where:
    >
    >1) A visitor add his or her name to an address book that can also be
    >viewed online by other visitors to the website.
    >
    >In creating this, I will also need to:
    >
    >2) Allow that visitor to create a username and password to add his/her
    >information.
    >
    >3) Allow that visitor to make changes and updates to his or her entry in
    >future visits to the website.
    >
    >and...
    >
    >4) Create an automated system for that user to retreive his/her username
    >and/or password if s/he has forgotten it.
    >
    >[/color]


    Using a database backend is likely the best thing to do. It adds a new
    set of requirements to the server and application but would be well
    suited for the task.


    --
    Scott Orsburn
    scottso_no@spam _maclaunch.com

    Comment

    • truckmen

      #3
      Re: A user-accessible address book using php?

      ***Using a database backend is likely the best thing to do. ***
      ***It adds a new set of requirements to the server and application but
      would be well suited for the task. ***

      Not sure what you mean by database backend.

      I still must try to understand how to integrate an Excel file that has
      names already listed with the various cells.

      I have not seen this file yet nor have I begun to understand just how
      integrate it into theis system. Am I on the right track though?

      Ralph


      Comment

      • Pedro Graca

        #4
        Re: A user-accessible address book using php?

        truckmen wrote [lines edited and re-ordered]:[color=blue]
        > I still can't figure it all out.
        >
        > I am trying to create a web page (using php) where:
        >
        > 1) A visitor [to the website can view an] address book.[/color]
        [color=blue]
        > I have MySQL and PHP available to work with.[/color]

        After a visit to the manual





        start with this:

        <?php
        define('DBHOST' , 'localhost');
        define('DBUSER' , 'nobody');
        define('DBPASS' , 'password');
        define('DBDATA' , 'address');

        echo '<h1>Address book view</h1>';
        echo '<table>';

        $conn = mysql_connect(D BHOST, DBUSER, DBPASS)
        or die('Cannot connect: ' . mysql_error());
        mysql_select_db (DBDATA) or die('Cannot select the DB.');
        $sql = "select * from addressbook order by name LIMIT 20";
        $res = mysql_query($sq l) or die('Query error: ' . nysql_error());
        while ($row = mysql_fetch_arr ay($res)) {
        echo '<tr>';
        foreach ($res as $value) {
        echo '<td>', $value, '</td>';
        }
        echo '</tr>';
        }
        mysql_free_resu lt($res);
        mysql_close($co nn);

        echo '</table>';
        ?>

        [color=blue]
        > [The visitor can add addresses to the database][/color]

        and this (with an appropriate form):

        <?php
        $name = $_POST['name'];
        $address = $_POST['address'];
        $sql = "insert into addressbook (name, address) values('$name', '$address')";
        mysql_query($sq l) or die('Query error: ' . mysql_error());
        ?>
        [color=blue]
        > In creating this, I will also need to:[/color]

        Hey!, start easy :-)



        Or there's always the option of a pre-made script and tailoring
        it to your needs.
        --
        Mail to my "From:" address is readable by all at http://www.dodgeit.com/
        == ** ## !! ------------------------------------------------ !! ## ** ==
        TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
        may bypass my spam filter. If it does, I may reply from another address!

        Comment

        • Scott Orsburn

          #5
          Re: A user-accessible address book using php?

          truckmen wrote:
          [color=blue]
          >***Using a database backend is likely the best thing to do. ***
          >***It adds a new set of requirements to the server and application but
          >would be well suited for the task. ***
          >
          >Not sure what you mean by database backend.
          >
          >I still must try to understand how to integrate an Excel file that has
          >names already listed with the various cells.
          >
          >[/color]


          truckmen, can you describe your level of knowledge about PHP and what
          you're trying to do so that I don't assume too much? We need to be sure
          you're comfortable with the tools you're trying to use. It will help a
          bunch. For example, in your original post you mentioned a public
          address book. However, Excel will not be a factor other than this is
          apparently what the data was collected with. Instead, your data will be
          stored in a database and accessed using PHP (server-side) and a web
          browser (client-side). Any "integratio n" with Excel will be a text file
          export of the database at best.


          --
          Scott Orsburn
          scottso_no@spam _maclaunch.com

          Comment

          • Kenneth Porter

            #6
            Re: A user-accessible address book using php?

            All the features you describe are things that any bulletin board system
            provides. So go take a look at the source to one of those and see how they
            do it.

            Comment

            Working...