Hi!
Being very very new to CakePHP I'm building a website admin registration form
(based on a tutorial, but with some differences). I have a form that collects
the prospective registrant's info but ALSO I'd like at the outset to show the
administrator (who is the only person who can access this form - s/he can enter
the names of the 4 or 5 staff members who can make basic changes to the site if
they have the right permissions) the users already registered - they are called
"knownusers" as you can see in the form. The controller defines the knownusers
function within the register function, as I want to use knownusers within the
registration form.
While my current setup doesn't throw an error, it doesn't display any known
users, either. Can anyone point me in the right direction?
Thanks heaps!
-Will
PHP version: 4.4.7 on Linux
Cake: most recent stable version as of yesterday
Code follows ============= SNIP =============
<form action="register" method="post">
<table width="45%" border="1" align="center" cellpadding="25" cellspacing="0">
<tr>
<td><p> </p><table width="90%" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr><td><pre><?php $knownusers ?></pre>
</td>
HERE WE TAKE REGISTRATION INFO INTO FIELDS SO CONTROLLER CAN DROP IT
INTO THE DATABASE UPON SUBMISSION
</td></tr></table>
</form>
<?php
class UsersController extends AppController
{
function user(){ }
function register()
{
if (!empty($this->params['form']))
{
$this->set('knownusers',$this->User->findAll(null,
array('id','username','first_name','last_name'),'id DESC'));
if ($this->User->save($this->params['form']))
{
$this->flash('Your registration information was accepted.
','/users/register');
}
else {
$this->flash('Sorry, there was a problem with your
registration.','/users/register');
}
}
}
}
?>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---