Jump to content

[SOLVED] Guest Login


Ell20

Recommended Posts

Hi,

 

I have started creating a website which sports clubs can register their club and fill out information about themselves, these members are set as admins. Then members of that club can use a separate registration to register to their club, these are set as members. This is all working perfectly.

 

What I would like to do now is to allow "Guests" i.e users which don't want to register but only get limited access to pages.

 

I have set up a dynamic drop down box on the login page which lists all the clubs currently available. How do I go about logging the guest into the club they want to once they have selected their club from the drop down box then press login as guest?

 

Thanks for your help

Link to comment
Share on other sites

If guests will have limited access, why do they need to log in as guest?  Is it for tracking purposes?  If so, just create a id called guest and don't require a PW.

 

I need some kinda of login for guests because there will be lots of websites based on different sports clubs, so without this there would be no way to determine which club to log the guest into.

 

Thanks

Link to comment
Share on other sites

Ok I have now set it up so that when a new club is registered an account called Guest, with no password is set up.

 

I now need to link my drop down box, which shows all the clubs available to login to, so that when the club is selected they are logged in as Guest with the correct club.

 

My code for the drop down box is:

<?php 
require_once ('mysql_connect.php');
$sql = "SELECT * FROM club";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)){
$club_id = $row["club_id"];
$clubName = $row["clubn"];
$club_id == $OTHER_CLUB_ID ? $sel = 'SELECTED' : $sel = '';
?>
<option value="<?php echo $club_id ?>" <?php echo $sel ?>><?php echo $clubName ?></option>
<?php 
} ?>
</select>

 

Appreciate any help.

Link to comment
Share on other sites

Im fairly new to PHP so I dont no all the ins and outs yet.

 

I have a session which is created when a normal user logs in.

 

I dont really have much idea how to set up the guest login which is why I was hoping to get some help here.

 

Thanks

Link to comment
Share on other sites

I think ive done it now.

 

The session holds the user_id and the club_id of the user logged in.

 

For that reason I have set it up to automatically create a guest account when a new club is created.

 

Thanks for the original idea of doing it this way.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.