[SOLVED] Change fields depending on logged in

notexa 02 Jul, 2007
I want to create a form that will be emailed to 3 persons. But the form should change depending if the user is logged in or not.

Name and email should be automatically taken from the database if the user is logged in and certain checkboxes should be checked/unchecked depending on logged in status.

Is this somehow possible ?
Can I use ($my) with chronoforms ?<br><br>Post edited by: notexa, at: 2007/07/02 15:17
GreyHead 02 Jul, 2007
Hi notexa,

Can I use ($my) with chronoforms ?



Yes you can and that's how to make your form change. You'll need to include
<?php global $my; ?>
in your form html as ChronoForms doesn't declare it by default. Then you can construct the php to make your form show the different inputs and values.

If I were doing this I think I'd look at two separate sets of form code and a switch or if statement. This makes it a bit easier to debug, you could always consolidate later.

Bob
notexa 02 Jul, 2007
Good tip, and thanks for poiting out the global declaration. That was the part I was overlooking.
This topic is locked and no more replies can be posted.