As I mentioned in an earlier email. Mac users can't register for the
test site i'm building and I have no idea why this is. Here's some
information that may help diagnose this problem:
- The site is running on Apache1.3.14 on a Windows O/S.
- I'm not checking for browser type
- All authentication is done through a MySQL database.
- The actual signup page is an html page and sent to a PHP page that
accepts/denies the information submitted.
Here's the actual coding for the newmemberacceptance.php page (the page
that accepts or rejects a new user).
Thanks,
Mike
<?PHP
//destroy existing session if it exists
if(session_is_registered("CUserName"))
{
session_destroy();
}
include ("dblib.inc");
session_start();
?>
<HTML>
<HEAD>
<TITLE>Member registration</TITLE>
</HEAD>
<BODY>
<?PHP
//registers session variables for later use
session_register ("CUserName");
session_register ("CFirstName");
session_register ("CLastName");
//saves session variables for later use
$CUserNameSession="CUserName";
$CFirstNameSession="CFirstName";
$CLastNameSession="CLastName";
print "Thank you for your interests in LDSCalgary.com $CFirstName
$CLastName<BR><BR>";
/*************************************************************************************
This is function tests for matching passwords
*************************************************************************************/
if (empty($CUserName))
{
print "UserName is empty<BR>";
exit();
}
if(empty($CPassword))
{
print "You must choose a password<BR>";
exit();
}
if($CPassword == $CPassword2)
{
print "";
}
else
{
print "Passwords do not match.<BR>Please press on the back button and
re-enter your passwords so they match.<BR>";
session_destroy();
exit();
}
/*************************************************************************************
This is function tests for user information
*************************************************************************************/
if (isset($CUserName) && isset($CPassword) && isset($CFirstName))
{
//checking for user input
$dberror="";
$ret=add_to_database($CUserName,$CFirstName,$CLastName,$CCity,$CEmail,$CGender,$CCommunity,$CAge,$CHeight,$CMarital,$CKid,$CBody,$CEducation,$CChurch,$CWard,$CStake,$CTemple,$CMission,$CMissionLocation,$CUrl,$CGreeting,$CPassword,$CMailingList,$CEyeColor,$CHairColor,$Interests1,$Interests2,$Interests3,$Interests4,$Interests5,$Interests6,$Interests7,&$dberror);
if(!$ret)
print "Error: $dberror<BR>";
else
print "Congratulations! Your profile has been added.<BR>";
}
/*************************************************************************************
FUNCTION: add_to_database
PURPOSE:
Add data to clients / interests table in Database
*************************************************************************************/
function
add_to_database($CUserName,$CFirstName,$CLastName,$CCity,$CEmail,$CGender,$CCommunity,$CAge,$CHeight,$CMarital,$CKid,$CBody,$CEducation,$CChurch,$CWard,$CStake,$CTemple,$CMission,$CMissionLocation,$CUrl,$CGreeting,$CPassword,$CMailingList,$CEyeColor,$CHairColor,$Interests1,$Interests2,$Interests3,$Interests4,$Interests5,$Interests6,$Interests7,&$dberror)
{
$result = mysql_query("SELECT CUserName FROM clients WHERE CUserName =
'$CUserName'");
$count = mysql_num_rows($result);
if ($count >= 1)
{
print "I'm sorry, the user name you selected is currently in use,
please select another.<BR>Please press on the back button of your
browser.";
exit;
}
else
{
$query = "INSERT INTO clients
(CUserName,CFirstName,CLastName,CCity,CEmail,CGender,CCommunity,CAge,CHeight,CMarital,CKids,CBody,CEducation,CChurch,CWard,CStake,CTemple,CMission,CMissionLocation,CUrl,CGreeting,CPassword,CMailingList,CEyeColor,CHairColor)
VALUES
('$CUserName','$CFirstName','$CLastName','$CCity','$CEmail','$CGender','$CCommunity','$CAge','$CHeight','$CMarital','$CKid','$CBody','$CEducation','$CChurch','$CWard','$CStake','$CTemple','$CMission','$CMissionLocation','$CUrl','$CGreeting','$CPassword','$CMailingList','$CEyeColor','$CHairColor')";
//Inserts interests data from form into Interests table
$query2 = "INSERT INTO interests (I1,I2,I3,I4,I5,I6,I7,CUserName)
VALUES
('$Interests1','$Interests2','$Interests3','$Interests4','$Interests5','$Interests6','$Interests7','$CUserName')";
}
if (!mysql_query ($query2) or !mysql_query($query))
{
$dberror = mysql_error();
return false;
}
return true;
}
/******************************************************************************************
This prints out the user input on the screen
******************************************************************************************/
foreach ($HTTP_POST_VARS as $key=>$val)
if (gettype($val) == "array")
{
print "$key:<BR>\n";
foreach ($val as $two_dim_value)
print ".....$two_dim_value<BR>";
}
else
{
print "$key: $val<BR>\n";
}
print "<BR>";
?>
<B>Click <a href="memberprofile.php?<?=$PHPSESSID; ?>">here</a> to
continue.</b>
</body>
</html>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]