HI There
I was wondering if there is a way of ONLY allowing registered users to use the form? I'm using Joomla 1.5.6
Background:
I have an Ask a Psychic feature on my website. Where a user clicks on an image linking to the form. But I only want the form to be available for registered users only.
Can anyone help?
ChronoForm is great by the way! Works real well.
Cheers
Shelby
I was wondering if there is a way of ONLY allowing registered users to use the form? I'm using Joomla 1.5.6
Background:
I have an Ask a Psychic feature on my website. Where a user clicks on an image linking to the form. But I only want the form to be available for registered users only.
Can anyone help?
ChronoForm is great by the way! Works real well.
Cheers
Shelby
Hi sighani,
Yes you can - you need to look up the user_id in the User object - if it's 0 then the user is either a guest or not logged in.
You can access the user object with this code in your form html
Bob
Yes you can - you need to look up the user_id in the User object - if it's 0 then the user is either a guest or not logged in.
You can access the user object with this code in your form html
<?php
$user = JFactory::getUser();
if ( $user->id == 0 ) {
// this is a guest . . .
} else {
//this is a logged in registered user
}
?>Bob
Hi Bob
Thanks for that. It's a bit over my head though as I don't know much about php. I did put the code in the form html.
I tested out the form and it still allows non registered users to use the form.
I may have missed something here?
Thanks for that. It's a bit over my head though as I don't know much about php. I did put the code in the form html.
I tested out the form and it still allows non registered users to use the form.
I may have missed something here?
Hi sighani,
Yes, you need to add your form code or other messages in where I left comments.
You will need a little knowledge of php & html to get this to work correctly, it really isn't practical for Max or I to code everyone's forms for them in full detail.
Bob
Yes, you need to add your form code or other messages in where I left comments.
You will need a little knowledge of php & html to get this to work correctly, it really isn't practical for Max or I to code everyone's forms for them in full detail.
Bob
This topic is locked and no more replies can be posted.
