To link to this article from your blog or webpage, copy and paste the url below into your blog or homepage.
The Personal Status Board (PSB™)
PSB
The Free Personal Status Board (PSB™) is our contribution to social connectedness, parenting, and ultimately social evolution.
PSB™ Version Comparison | |||||
PSB™ Version | Change Status/Comment | Front End | 100 Customizable Status Codes | Price | |
---|---|---|---|---|---|
Standard PSB™ | anyone can change anyone's status | No | Yes | No | Free |
PSB™ Pro | anyone can change anyone's status | Yes | Yes | No | Now free! |
Social PSB™ | you can only change your own status | Yes | Yes | No | Now free! |
Social PSB™ Plus | you can only change your own status | Yes | Yes | Yes** | Now free! |
Business PSB™ | you can only change your own status | Yes | Yes | No | Now free! |
Business PSB™ Plus | you can only change your own status | Yes | Yes | Yes** | Now free! |
** Click on the PSB™ members' Names in the PSB™ in order to open their email program and send them a message.
The simplest way to grasp the significance of the social networking technology called the Personal Status Board (PSB™) is to consider the analogy that follows below. There is a kind of software called an "RSS reader", "feed reader", or "aggregator." Examples: FeedDemon, Feedreader, Google Reader, or the readers built into browsers such as Internet Explorer, Firefox, and Safari. Why are they significant technological advances? They leverage your time by being efficiency multipliers. Think of the time it takes to go to 2 dozen different websites or blogs to check up on the latest news from your favorite news, entertainment, or special interest sites. Now compare this to a feed reader. You simply go to ONE site—the feed reader—and listed conveniently in one place is ALL the newest info from ALL these sites. This assumes these sites and blogs have "RSS" feed reader buttons (all significant, worthwhile sites do, these days) that you can click on and subscribe to, and that you do so. Once you subscribe, YOU no longer go to THEM. Now THEY come to YOU. It might take an hour or more to surf around to all these 24 sites/blogs and catch up on the latest info. But it takes only a couple of minutes to peruse a feed reader, see which of the feed headlines seem worth reading more about, and read through them. You've just done the same thing you used to do in an hour only it took you only a couple of minutes to accomplish it. That's a 2000% to 4000% efficiency increase. A similar type of efficiency increase can be experienced with a PSB™ as compared to usual social networking technology.
Comparison of Various Social Communication Methods | |||||
Method | Communicates Current Status | Communicates Current Comment | Customizable Status Codes | See All Friends' Statuses at Once | |
---|---|---|---|---|---|
Personal Status Board (PSB™) | Yes | Yes | Yes | Yes | |
Google Plus+, Facebook, Bebo, etc. | Rarely | Rarely | Only Emoticons | No | |
Rarely | Rarely | No | No | ||
Phone (voice) | Yes | Yes | No | No | |
Texting | Yes | Yes | Only Emoticons | No | |
IMing | Yes | Yes | Only Emoticons | No | |
Emailing | Rarely | Rarely | Only Emoticons | No |
As you can clearly see, if you can see all friends' statuses (plus comments) at once, you needn't contact each individually by texting or email or IM (or go to their Google Plus+ or Linkedin or Facebook page where the info is usually far from current) to find out what they are currently into. Simply peruse the PSB™. (You'll find at least a couple whose current status is such that you want to help them, talk with them, go with them somewhere, or share some news or gossip. But it will take you under a minute to "catch up"—which means learn their current status— with dozens of friends or family at once!) Once you and a few of your friends experience the quantum leap of efficiency a PSB™ offers, you'll all tell all your friends, family, colleagues, and acquaintances about it and you'll have 20 to 30 members in your PSB™ enjoying the first truly efficient social networking ever devised.
So the analogy here is now obvious:
as
PSB™ is to normal totally inefficient social networking
The Standard Personal Status Board (PSB™) is for programmers who like coding. If you are not a programmer, get the PSB Pro Version.
Any PSB, including the Standard and Pro versions, are 1-page websites that functions as a communications center that can inform any/all of the group members about the personal statuses of each of the group members.
With the Standard and Pro versions, any group member can update/edit status codes and comments of anyone once s/he logs in (trust is implied) although normally members would update only their own status and comment. It can allow children to get their needs met better, parents to meet their kids' and their own needs better, caregivers to find out which kids want a different nurturer currently, group members to declare their need to be alone (do not disturb), etc. There are 100 customizable status codes in which general feelings, needs, wants, desires, and openness can be expressed to the group, and coordination of activities can be greatly facilitated due to the fact that any group members can consult it (keeping it open as a window on their computer screen) and instantly learn what everyone else is into. Along with this new level of social connectedness, a calendar program for groups would be a great way to see specific schedule details to coordinate activities. For larger groups, Office Calendar for Outlook or AirSet Cloud Computers is good, and for smaller groups, Cozi Family Calendar is good.
Returning to the subject of PSB™s: Think about it—how often do you, your kids, or your friends simply plop down in front of the boob tube or play video games or check out YouTube videos simply because trying to deal with the logistics of getting together with one or more friends for real, old fashioned direct social contact seems like too much of a bother? How many parents, or adults in general, say they're too busy to pursue friendships? How many kids are too busy playing video games or watching TV or texting or updating their Facebook page to pursue f2f (face to face), irl (in real life) relationships and how many of their parents are seriously concerned about this social opt-out? And yet if socializing irl and f2f was easy and effortless, would your answer be the same? Now contrast a quick glance at a PSB™ with the time and effort it takes to call all your friends and mostly get voicemail or "sorry, I'm too busy now" responses. They were disturbed to no avail and you were left singing the blues. And if people go to Facebook to see exact current statuses of friends, what do they find instead? A lot of links to cool music, movies, and current popular culture trends. See why PSB™s are super empowering for the entire relationship context of any families or group of families (like MCs—see below), groups of close friends, or members of closeknit organizations where members are often interacting?
Harvard Business School has finally solved one of life's eternal mysteries: What people actually do on social networks. According to research by Harvard Business School's Mikolaj Jan Piskorski, people spend 70% of their time on social networks looking at profiles and photos. More specifically, the top three activities on social networks are: men looking at women they don't know, men looking at women they do know, and women looking at women they know. And in general, when the average person goes to a social network, they mostly look at links about music, links about movies, cool photos, and around a third of the time they check out paid advertisements from sponsors or clubs or profiles started by commercial interests. And surveys say that 63% of women on Facebook say that complaining from Facebook friends was their number one pet peeve, with political chatter and bragging coming in a distant second and third. And of course discussions of natural disasters, clothes, news, politics, and gossip were frequent status updates as well. Amongst all these communications is a new HMU (hit me up) trend for people wanting to get together, but much of this is drowned out by status updates about Justin Bieber, popular culture, song lyrics, sports, games, iPads and iPhones.
In other words, most status updates AREN'T status updates, but communication about whatever happens to be on someone's mind, however mundane or trivial or irrelevant. These communications happen infrequently enough that they're rarely CURRENT, and when they happen they reflect only the status that someone is on their computer or iPhone catching up with the current popular culture trends and cool photos or YouTube videos. PSB™s, on the other hand, are about what people are currently doing, needing, feeling, where they want to or need to go, rides needed or offered, nurturing and/or childcare, scheduling get-togethers, and other real-world activities and concerns. Once users learn to update frequently, they see a quantum leap in social effectiveness and efficiency that empowers social connectedness, parenting, and ultimately social evolution. They become meaningfully connected rather than meaninglessly caught up with the current popular culture trends.
Even though PSB™s can be a huge empowerment tool for friends who rarely if ever meet irl and f2f, leveraging connectedness and greatly increasing the quality of what is shared, their most important use for facilitation of lifestyles that really WORK and contribute greatly to social evolution is when they get applied to MC living. Read on:
What Is An MC? MC stands for microcommunity. It refers to an intentional subcommunity whose setting is a normally-structured block-house neighborhood (or partial neighborhood; e.g., six homes) or apartment neighborhood (e.g., one floor or one partial floor) that contains from 10 to 40 people who’ve intentionally computer-selected their members for great compatibility and relocated to this MC (a few may already have lived at this location, but the odds against many of them already living there are great, due to compatibility probabilities), and who’ve adopted certain proven modes of considering each other (who are or will become best friends) as social resources for child care, eldercare, and other nonsuperficial levels of communication that, when appropriate, is facilitated by P.E.T. (Parent Effectiveness Training), or one of the other authoritative parenting styles, and by PSB™s.
How Are MCs Different From Other Lifestyles? MCs are not random aggregations of people. MC people have intentionally selected one another and become best friends and therefore trust fellow members with child care and eldercare—and in other ways. So they’re not stuck with putting kids into day care centers with strangers who don’t care about their kids—their MC contains only people who care about them and their kids. Care is given by MC members, not strangers. And care is flat-gradient nurturance (more caregiver choices) rather than steep-gradient nurturance, which is forcing kids to have one or two caretakers when they prefer a situation of several choices since sometimes parents don't feel like being around their kids and when they do it anyway, low quality care results. With steep-gradient nurturance, parents choose who will care for kids, and when, regardless of the kids' wants and needs, but in MCs the flat-gradient nurturance allows kids to choose their caregivers. (This is in keeping with the tenets of Attachment Parenting in which kids needs are filled when the kids manifest them and how kids want them filled, where possible, and this applies to caregiver choice as much as when to nurse them, feed them, comfort them, etc. If kids usually choose to be cared for by parents, that's fine, but the critical issue here is the kids need to be able to CHOOSE.) Reitterating: kids choose whom to be with, to the largest degree possible. And abuse becomes nearly impossible, since there are other nurturers in whom the kids confide, and because kids would not choose to be with an abuser. And the communication and parenting style in an MC is P.E.T. (Parent Effectiveness Training) or one of the other authoritative parenting styles. However, not just parents but all relationships in the MC use this style, as it is the most effective for nurturing, conflict resolution, sensitivity to feelings, etc.
MC families live in normal houses and apartments as normal nuclear, single parent, extended, and mixed types of families. MCs are free to choose, if they prefer, only certain types of people, certain races, certain religions, all two-parent nuclear families, all singles, or whatever—people that choose each other really like each other and respect each other’s values and interests. The wrong way to maximize social resources is via communes, socialism, communism, fascism, gurus, cults, etc. They give the very idea of maximal resources a bad name. The right way to maximize social resources is to empower democracy and responsible independence and leave people’s physical living modes and family styles alone. Instead, concentrate on making the relationships work optimally between spouses, parents and children, friends, committed neighbors, and committed relatives, so that they produce happiness, optimal childcare, fulfillment, and self-actualization, not symptoms and dysfunctional lifestyles.
PSB™s help grease the relationship wheels!
Personal Status Boards (PSB™s)
There are actually six types of PSB™s: The first we refer to as an MC PSB™, where there is implied trust in a close group so that everyone can share one password and user name and anyone can change anyone's status or comment—a must for childcare situations where there are caregivers updating statuses of children too young to do it themselves. If an MC finds out that a few members find the temptation of shenanigans too great to resist, so they play pranks with each other's statuses and comments, the MC is free to upgrade to the Social PSB™, where people all have their own user names and passwords and they can change only their own statuses and comments. Even though few people would know passwords and user names except their own, parents would need the passwords and user names of their young children who are too young to update their codes. MC PSB™s empower holistic social networking that is more EFFICIENT AND EFFECTIVE than usual social networking methods, and they take many of the headaches out of the childcare area—with which so many Americans are now struggling.
So the first and second types of PSB™s are the Standard version and the Pro version. The Standard version is described on this page, and it is ONLY for programmers who like to play with code. Ignore it if you just want a convenient PSB. It requires more file edits as well as having to type the people data into a MySQL database (which is free on all reputable hosts) on your website's server via the control panel. This data entry is fast and easy but needed. Unlike the Pro version and all other PSB™s, it has no "front end"—so anything you want to edit (except for statuses and comments, which users will change by simply using the PSB™), you type into your MySQL database on your website's server via the control panel. The Pro version has a front end for administrator hosts to use for all editing of membership or user data. It's a complete application, as are the Social and Business PSB™s. A front end refers to the administrator webpage which has a menu that serves as an easy way for administrators to edit usernames, passwords, emails, status code meanings, administrator data, and add or delete users, etc. All PSB™s except the Standard version have this front end. The Pro version is the only other "MC-type" PSB™ beside the Standard version and this means there is implied trust in a close group so that everyone can share one password and user name and anyone can change anyone's status or comment.
ALL types of PSB™s require MySQL and a host (your website's host) to host the PSB™ files, as well as "creating" a database (simply name a MySQL database), and adding at least one user with one password, with permissions, that pertain to the database. It's easy and there are this site and/or this site to guide you—they have tutorials on doing this. (For all PSB™'s EXCEPT the Standard one: Once the database is ready and you edit and upload the configure.php file we'll send you along with the application files, that's it. Register as a member and enter your PSB™'s user names. There will be a readme.txt to guide you. Your register.php file will have been uploaded by you to your site at http://yoursite.com/PSB/register.php so save it as a Favorites link.)
Standard PSB™ users will not register—they will simply "create" (simply name it) a MySQL database (free), enter a user and password and permissions (all), use phpMyAdmin on the server control panel to enter data, and upload the files downloadable from us. To use the Standard PSB™, go to http://yoursite.com/PSB/test-db-WORKS-GOOD.php or http://yoursite.com/test-db-WORKS-GOOD.php depending on whether you put the 6 files we send you in a folder or not. Once you get to this page, login and type your status and comment into the PSB™ and click the "Update PSB" button. This changes the PSB™ table in the database. Any other member of this PSB™ can log in and see this new status and comment as well as everyone else's, and they too will be able to change statuses and comments. There are 100 different status codes to use, and there's a chart of all the status codes and their meanings right after the status/comments display table. It looks like this.
If you have the PSB™ Standard version and you decide you wish to host multiple PSB™s (or at least get administration programs for editing from the Web rather than from a host's control panel), and you need PSB, registration, and administration files, we can help. You will need to get our PSB™ Pro version which will have a file called convert-standard-psb-to-pro-psb.php that will help you update any MySQL tables from the PSB™ Standard version. Contact us for details.
The third and fourth types of PSB™s are the Social PSB™, and the Social PSB™ Plus (with Email), where there is a group of friends or acquaintances or even relatives where trust, although sometimes present, is not implied, so each member gets his or her own password and user name and no one can change anyone's status or comment except his or her own. It's probably obvious that if everyone could change anyone's statuses and comments, for most groups of people this would be an open invitation to chaos and pranks. It's believed that a loving, trusting MC group would not misuse their PSB™s. Of course, if an MC finds out that a few members find the temptation of shenanigans too great to resist, they are free to upgrade to the Social PSB™. Social PSB™s empower holistic social networking that is more EFFICIENT AND EFFECTIVE than usual social networking methods.
The fifth and sixth types of PSB™s are the Business PSB™, and the Business PSB™ Plus (with Email), where there is a group of employees or managers or even projects whose status changes often, or where frequent communication is required and there is a need for a holistic overview of the person statuses or project statuses OF many persons or projects BY many persons or projects. As with general Social PSB™s, trust, although sometimes present, is not implied, so each member gets his or her own password and user name and no one can change anyone's status or comment except his or her own. Business PSB™s empower holistic intra-business or inter-business communication and networking that is more EFFICIENT AND EFFECTIVE than usual business networking methods. It may also be used to monitor telecommuting associates or remote contract workers or employees who work from home, temporarily or permanently.
No PSB, including the Pro version, is for sale. They are all free. This includes the Social PSB™ and the Business PSB™. The free Standard version is for examining code. Since all PSBs are free, get one or more of these fancier ones (like Pro version) and ignore this Standard version if you are not a programmer.
The source codes for the Standard version are right here in the zip file which clicking the button below will allow you to download. (See a demo of the PSB™ here on our PSB™ demo page.)
You may copy the files and use the PSB™ yourself for your family, group, MC, local group of families, babysitting co-op, or whatever—any legal, legitimate group that is not about violence or hate or crime or treason or porn may use our PSB™ software. This site and the files we let you copy are all copyrighted material and you may NEVER sell any of them in any way. You may not change or omit the words PSB™ or Personal Status Board anywhere on your site or in the code or metatags. The Personal Status Board (PSB™) is our name for this software, which was invented as a concept by M.C. Smith in 1988, and created as an electronic device in 1988 as well, although software on the Internet is a more viable form, now. There just wasn't much of an Internet in 1988! Anyway, MCs are our name for microcommunities, although you're free to use the term however you like (but we'd prefer people use it in the sense presented on this website). PSB™s, however, are intellectual property and software copyrighted and trademarked by no one except MCS Investments, Inc., and any use of these materials not complying with the above terms will result in legal action. So please honor the above terms of use—it's really not too much to ask!
Here, then, are the names of the files needed to use this cutting edge tool of social evolution:
- change.png
- change-.png
- PSB_.jpg
- psb.js
- update.php
- test-db-WORKS-GOOD.php
Standard Version
or
Here's a printout of the entire update.php file. There isn't that much to it. It's easy to see what you need to change, but we go through it with you, below, pointing out the specific changes to make so the file represents YOUR database, table, passwords, and user names:
<html>
<head>
<style type="text/css">
BODY {background-color:#88f;}
</style>
</head>
<body>
<?php
$ID=$_POST['ID'];
$status=$_POST['status'];
$comment=$_POST['comment'];
$ttt=$_POST['ttt'];
mysql_connect("localhost", "your_username", "your_password") or die(mysql_error());
mysql_select_db("your_database") or die(mysql_error());
$comment = strip_tags($comment);
$pattern =
'/[^a-zA-Z0-9\\s\\.\\,\\!\\;\\-\\_\\"\\?\\047\\:\\(\\)\\/]/i';
$comment=preg_replace($pattern, "", $comment);
$comment=mysql_real_escape_string($comment);
$comment=$comment."|".$ttt;
$query="UPDATE your_db_table SET Status='$status', Comment='$comment' WHERE ID='$ID'";
mysql_query($query) or die ("Trouble updating database");
mysql_close();
?>
<form name="MyForm" method="POST" action="test-db-WORKS-GOOD.php">
<input type="hidden" name="flag" value="1">
</form>
<script language="javascript">
document.MyForm.submit();
</script>
</body>
</html>
In order to use the update.php file, you need to change "your_username", "your_password", "your_database", and "your_db_table" into correct values ("localhost" can usually be left as it is without changing it) and resave the update.php file. Then fix the password code in test-db-WORKS-GOOD.php:
$o = array("your_user_name1+your_password1","your_user_name2+your_password2",
"your_user_name3+your_password3","your_user_name4+your_password4",
"your_user_name5+your_password5","your_user_name6+your_password6",
"your_user_name7+your_password7","your_user_name8+your_password8",
"your_user_name9+your_password9","your_user_name10+your_password10",
"your_user_name11+your_password11","your_user_name12+your_password12");
—so it has the correct username/password pairs separated by plus signs. If each person has their own password and user name, you may add as many more username/password pairs as you like, or reduce them down to one that everyone can use. And then, also in test-db-WORKS-GOOD.php, change these lines to represent your particular values:
// Make a MySQL Connection
mysql_connect("localhost", "your_user_name", "your_password") or die(mysql_error());
mysql_select_db("name_of_db") or die(mysql_error());
// Retrieve all the data from the "name_of_db_table" table as a MySQL Resource
$result = mysql_query("SELECT * FROM name_of_db_table") or die(mysql_error());
And then, also in test-db-WORKS-GOOD.php, change the name_of_db_table value in the following to your value, then resave the file:
$myArray=array();
$res = mysql_query("SELECT Firstname FROM name_of_db_table") or die(mysql_error());
while ($row = mysql_fetch_row($res)) {
array_push ($myArray, $row[0]);
}
$myArray2=array();
$res = mysql_query("SELECT Status FROM name_of_db_table") or die(mysql_error());
while ($row = mysql_fetch_row($res)) {
array_push ($myArray2, $row[0]);
}
In order to use these files, you also need to have a website and get a MySQL database installed for you by the host and make sure your host server has PHP 5.2 or higher (PHP added a JavaScript Object Notation—JSON—extension to PHP V5.2, which was previously only available as add-on, and it is enabled by default in PHP, but if your host has it disabled, have him enable it). Most hosting plans include MySQL databases and JSON-enabled PHP 5.2 or better anyway, so you just need to access the cPanel X control panel, go to the utility called MySQL Databases, give your MySQL database a name, enter all your members' user names and passwords, select maximum permissions for each user name, save them, then—lower down the page—add these users to your newly named MySQL database. Then use the phpMyAdmin utility and access the MySQL database you named, create a table in it, insert data in the table, and save this as well. The phpMyAdmin utility should be in the Databases section of the control panel. It allows easy, intuitive access to enter and edit tables in your database. Of course, after startup, editing of status and comment data is done through PSB™ interfacing by members. We suggest guidance from this site and/or this site for using phpMyAdmin and entering tables in your MySQL database—it's easy and requires no programming at all. Just follow the simple tutorials. For security's sake, make sure passwords use some special characters like $#@!*^&% as well as letters and numbers. In use, once people are logged in (by going to http://yoursite/psb/test-db-WORKS-GOOD.php), they can update statuses and comments as much as they wish. We can't say if your host logs people out after a long period of inactivity—ours hasn't so far. At worst you then log back in. This can be made quicker and easier with RoboForm. It's free!
When you enter data, you need to set up 4 fields.
The first field should be named Firstname, it should be of the type "varchar", and it should have a maximum character allotment of 12.
The second field should be named ID and it should be set to be the PRIMARY field, it should be of the type "int", and it should have a maximum space allotment of 2. When entering ID data, the first record MUST have a 1 for its ID, the second a 2, etc. IMPORTANT! It is critical that these ID numbers are sequential, that they begin with 1, and that there are no gaps or the PSB™ won't work right!!!!! So if you dump a member, renumber all IDs from him to the end so NO number is skipped. And if you add a member, add him at the end as the last record and give him the next sequential number after the last member ID. (The Pro version has no special rules like this, and needs no editing in the control panel. Nor do the Business PSB™ or Social PSB™.)
The third field should be named Status, it should be of the type "char", and it should have a maximum character allotment of 2, and no less than 2 characters should ever be entered. Enter any old numbers for now—members will change them once your PSB™ is live.
The fourth field should be named Comment, it should be of the type "varchar", and it should have a maximum character allotment of 60. You needn't enter comments in the database—you can wait for members to do it in the PSB™.
PHP Code (optional—in case you want to know how we built the PSB™)
We needed to do this PSB™ project and it required PHP. JavaScript lives on the browser and cannot address, create, display, or edit databases that live on servers. You cannot talk to MySQL unless the db interface is done with ASP or PHP. PHP lives on the server and it can address, create, display, or edit databases that live on its server. In practice, it is very convenient to create an HTML page with JavaScript routines for the browser action and, on the same page, PHP for the server action. All these languages on the same page requires that you give the page a .php extension. When you load a PHP website on the browser, the PHP stuff all happens on the server, then the browser loads the page, but doesn't load the PHP code, but rather it loads the RESULTS of the server's PHP actions. So you don't have to worry about people looking at your source code with View Source. Not only will the source leave out all PHP codes, it will also fail to display the HTML or Javascript that happens to be between PHP tags (<?php and ?>). In the case of our test-db-WORKS-GOOD.php page, that's most of the page, even though it's almost all HTML and JavaScript!
Now to look at the above code:
<html>
<head>
<style type="text/css">
BODY {background-color:#88f;}
</style>
</head>
<body>
<?php
$ID=$_POST['ID'];
$status=$_POST['status'];
$comment=$_POST['comment'];
$ttt=$_POST['ttt'];
As the name implies, the purpose of the update.php page is to update the PSB™ website page (test-db-WORKS-GOOD.php) with new data once it's entered and the "Update PSB™" button is clicked. In this update.php file (listed above), we do the HTML preliminaries, declare PHP, then grab the record number (id) and data in a specific record which the main page, test-db-WORKS-GOOD.php, will be "POST"ing to it once the user enters the data. (The local date and time is also there and ends up in the $ttt variable.) To reitterate, the whole purpose of this PHP page is to update the db once a user types in new entries on the form in the test-db-WORKS-GOOD.php page. The name of the form input fields are 'ID', 'status', and 'comment', and there is a hidden field in that form that gets the time, ttt, inserted into it. Whatever values are in these inputs when the "Update PSB™" button is pressed will be sent to this update.php page because the form action tells it to, via action="update.php". So now that we know what data goes in what record, we update the MySQL db record like so:
mysql_connect("localhost", "your_username", "your_password") or die(mysql_error());
mysql_select_db("your_database") or die(mysql_error());
$comment = strip_tags($comment);
$pattern =
'/[^a-zA-Z0-9\\s\\.\\,\\!\\;\\-\\_\\"\\?\\047\\:\\(\\)\\/]/i';
$comment=preg_replace($pattern, "", $comment);
$comment=mysql_real_escape_string($comment);
$comment=$comment."|".$ttt;
$query="UPDATE your_db_table SET Status='$status', Comment='$comment' WHERE ID='$ID'";
mysql_query($query) or die ("Trouble updating database");
mysql_close();
?>
We connect up with the db with special mysql commands. Note that we hard-wired in a user name and password so the process could happen without login, which will have already occurred on the main page, test-db-WORKS-GOOD.php. This is cool because there's no way to see this PHP code—it's on the server but NOT on the browser. Feel free to use the more standard way, a db configure file at the start of each PHP page as an include.
Next we use some security techniques. The first is to get out any potentially malevolent HTML tags with strip_tags(). Next we define a regular expressions pattern with acceptable characters. Then we use the PHP preg_replace() function to dump eveything except those characters. The 047 is single quote, which we've already used to surround the replacement pattern, so ' would not work. Next we use the trustworthy mysql_real_escape_string() function to escape all problematical characters, which you should always do before inserting data into a MySQL db table. Then we append the date-and-time variable to the end of the $comment variable, with | for a separator, which we will need back in the
test-db-WORKS-GOOD.php page when we address the db table and display its data.
We used the UPDATE command which uses WHERE and is saying when the id in the db table is the ID we POSTed to this page, we update that record only, since no others have that id number. Now it's time to get cute:
<form name="MyForm" method="POST" action="test-db-WORKS-GOOD.php">
<input type="hidden" name="flag" value="1">
</form>
<script language="javascript">
document.MyForm.submit();
</script>
</body>
</html>
We create a form whose action is to send us back to the test-db-WORKS-GOOD.php page from whence we came, but this form, as you can see, has no Submit button but merely a hidden field with a value to send, which is merely a flag that means our update was done. Finally, we use JavaScript to submit the form to test-db-WORKS-GOOD.php with that flag value. The cool thing about not having a Submit button is that this whole page is totally automatic and it loads, updates, and leaves in under a second—which is experienced as a quick page reload in our main page, test-db-WORKS-GOOD.php. If you blink, you miss it.
Need more? Explanations of the entire main PSB™ page are here PHP Info and here More PHP Info.
We gave 2 links to tutorials on the simple task of db setup, above. But what if you decide you want to change the meaning of code 98 from "Writing a letter" to "Doing my homework," or "Working at my job"? Or whatever. Simply load psb.js into a text editor, find "Writing a letter" second from the end, change it, and resave the file. Now it will display as the changed value for everyone in your group. (To edit, load it into your text processor (NotePad or Editor2) by right-clicking the file name in your file manager and choose Open With . . .) We suggest getting your group's permission before changing array values. With the demo, you'll need to change arrays in psb-demo.js as well:
var IDs = new Array(1,2,3,4,5,6,7,8,9,10,11,12);
var memstatus=new Array('01','02','23','45','04','03','73','97','13','11','07','66');
var fname=new Array('Fred','Shirley','Barbara','John','Sue','Ferdinand','Sean','Doris','Bob','Georgia','Joe','Harriet');
var comments=new Array('I;m in a good mood.','with edna','Come on in.','I;m feeling creative!','zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz','Don;t knock!','Hey, I;d like to go down 5 to Portland.','Wheeeeeeeeeeeeeeeeeeee!!!!!!!!!','I prefer cool kids!','even soon','whatever','Poor me!');
Note that there are 12 members. To add 3 more, just append ,13,14,15 to the IDs array, 3 more status codes to the memstatus array, 3 more names to the fname array, and 3 more comments to the comments array. Be careful about syntax—don't forget any apostrophes or commas (but do not use apostrophes in comments for possessive case or contractions—use semicolons instead!). Replace our data with yours, as long as status codes are 2 digits and ids are consecutive digits that start with 1.
PSB™ Version Comparison | |||||
PSB™ Version | Change Status/Comment | Front End | 100 Customizable Status Codes | Price | |
---|---|---|---|---|---|
Standard PSB™ | anyone can change anyone's status | No | Yes | No | Free |
PSB™ Pro | anyone can change anyone's status | Yes | Yes | No | Now free! |
Social PSB™ | you can only change your own status | Yes | Yes | No | Now free! |
Social PSB™ Plus | you can only change your own status | Yes | Yes | Yes** | Now free! |
Business PSB™ | you can only change your own status | Yes | Yes | No | Now free! |
Business PSB™ Plus | you can only change your own status | Yes | Yes | Yes** | Now free! |
** Click on the PSB™ members' Names in the PSB™ in order to open their email program and send them a message.