MSFN Forum: validation for users when sign up for event - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

validation for users when sign up for event php programming Rate Topic: -----

#1 User is offline   kabucek 

  • Member
  • PipPip
  • Group: Members
  • Posts: 102
  • Joined: 07-August 06

Posted 17 November 2008 - 12:20 PM

Hello All,

I want to create php system that will validate when users
register for the event today (for example), it will check in mysql database if
they did not registered for this event before.
Any suggestions welcome.
Thanks !!


#2 User is offline   kabucek 

  • Member
  • PipPip
  • Group: Members
  • Posts: 102
  • Joined: 07-August 06

Posted 18 November 2008 - 02:38 PM

Hi @ll,


I have the following function to check when users register to our system.
It validates f.name, l.name and email address.




Quote

if (implode($errorArray)=='')

{

$checkMemberArray=$memberLink->getRecordMatch('userID', $memberDataArray['emailAdr']);



if ($checkMemberArray)

{

$cFirst=strtolower($checkMemberArray['first']);

$cLast=strtolower($checkMemberArray['last']);

$mFirst=strtolower($memberDataArray['first']);

$mLast=strtolower($memberDataArray['last']);

if ($cFirst!=$mFirst or $cLast!=$mLast)

{

$command="sendAccountMail"; $destPage=$PHP_SELF; $label="here";

$quote="\"";

$clickString="onClick=".$quote."document.$formName1.operation.value='$command'; document.$formName1.action='$destPage'".$quote;

$hrefString="href='java script:submitRoutine($quote$command$quote, $quote$formName1$quote)'";

if (!$label) { $label=$command;}

$$command="<A $hrefString $clickString>$label</A>";

$errorArray['emailAdr']="Mismatch email and name";

$processMsg.="

<DIV class=processMsgError>

The email address you entered today has been used in our system with a first and last name that are different than the ones you entered. <P>





</DIV>

";

}

else

{

$memberDataArray['first']=$checkMemberArray['first'];

$memberDataArray['last']=$checkMemberArray['last'];

}

}

}



How to update this code, so when users try to register even with the good credentials it will give the message:

" You are already registered for this event, if you continue you might be charged again".

If possible use query to connect with database?





?>

#3 User is offline   ripken204 

  • The Hardware Guy
  • PipPipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 6,311
  • Joined: 23-December 04
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 25 November 2008 - 12:26 AM

you must query the DB for this case.
i sure hope as hell that you give each user a unique id and that you store the registrations in a separate table which links the registrations to the unique user ids.
if you are, then it is as simple as, "SELECT * FROM registrations WHERE uid=$user[id] AND eventid=$event[id]"
if it returns at least 1 row then that means that the user is already registered for the specific event

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy