| Author |
Message |
CurtisH Life Cycles Becoming CPU Cycles

Joined: Mar 15, 2004 Posts: 638 Location: Waco, TX
|
Posted:
Thu Jul 22, 2004 6:19 am |
|
I am trying to determine how to make certain fields required in the new user registration and change info forms. Is this something that can be handled by a database modification or is it coded directly into the php? |
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2363
|
Posted:
Thu Jul 22, 2004 7:52 pm |
|
|
|
 |
CurtisH Life Cycles Becoming CPU Cycles

Joined: Mar 15, 2004 Posts: 638 Location: Waco, TX
|
Posted:
Thu Jul 22, 2004 8:36 pm |
|
I guess I should have mentioned that I am using NSN Your Account. The mod that you have suggested will replace key files in my version breaking its functionality (in other words I already tried that. *LOL*) and is in fact more suited for adding fields, I only want to make a few required. That is why I asked how to make them required.
Thank you for the quick reply though! That is one of the wonderful things about this site, the staff are very friendly and quick to reply.  |
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2363
|
Posted:
Thu Jul 22, 2004 8:59 pm |
|
Makiing existing ones requireds not so hard.
Before the insert statment add something like this.
if( $email == "" ) error( "E-mail required" );
In mainfile.php or the same file add something like this to print out pretty error pages.
function error( $error )
{
include("header.php");
OpenTable();
echo "<p align=\"center\"><font size=\"4\">Error: $error</font></center>\n";
echo "<p align=\"center\"><a href=\"javascript:history.back()\"><b>Back</b></a></p>\n";
CloseTable();
include("footer.php");
mysql_close();
exit;
}
Your validation of the $_POST variables could be a lot more complex this just looks to see if it has a value and if there is none throws and error page up. |
|
|
|
 |
CurtisH Life Cycles Becoming CPU Cycles

Joined: Mar 15, 2004 Posts: 638 Location: Waco, TX
|
Posted:
Thu Jul 22, 2004 9:04 pm |
|
Thank you so much! I will try it out tomorrow and post my results.  |
|
|
|
 |
sixonetonoffun Spouse Contemplates Divorce

Joined: Jan 02, 2003 Posts: 2363
|
Posted:
Thu Jul 22, 2004 9:05 pm |
|
I think nuke might use sql_logout(); for mysql_close(); Anyone????? |
|
|
|
 |
|
|
|
|