By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

A user-accessible address book using php?

P: n/a

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
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
truckmen wrote:
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.

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

Jul 17 '05 #2

P: n/a
***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
Jul 17 '05 #3

P: n/a
truckmen wrote [lines edited and re-ordered]:
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. I have MySQL and PHP available to work with.
After a visit to the manual
http://www.php.net/manual
http://www.php.net/manual/en/tutorial.php
http://www.php.net/mysql
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(DBHOST, 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($sql) or die('Query error: ' . nysql_error());
while ($row = mysql_fetch_array($res)) {
echo '<tr>';
foreach ($res as $value) {
echo '<td>', $value, '</td>';
}
echo '</tr>';
}
mysql_free_result($res);
mysql_close($conn);

echo '</table>';
?>

[The visitor can add addresses to the database]
and this (with an appropriate form):

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


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!
Jul 17 '05 #4

P: n/a
truckmen wrote:
***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.

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 "integration" with Excel will be a text file
export of the database at best.
--
Scott Orsburn
scottso_no@spam_maclaunch.com

Jul 17 '05 #5

P: n/a
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.

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.