News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Placing Login Box on my Home Page

Started by backend, January 14, 2006, 03:22:37 AM

Previous topic - Next topic

backend

There was an old topic about this, but it was more than 120 days old so it was no longer used.

I basiclly want to add a login box to my home page, so people can log into the forum right from the home page.

What do I have to do to accomplish this?

I was given this sample code, but dont know what to change in it and where to place it?

Quote<?php
require_once("{$_SERVER['DOCUMENT_ROOT']}/forum/SSI.php");

//if person is in membergroup that should be able to see this then do stuff, else log in.
if (in_array(9, $user_info['groups']))
{
    $who=$context['user']['name'];
     //snipp bunchacodea
}
else
    page_login();

//my own wrapper
function page_login()
{
echo <<<EOT
   <html><head><link REL="stylesheet" TYPE="text/css" href="pband.css">
   <title>First United Methodist Church of Pflugerville: Praise Band Uploads (Login)</title></head>
   <body>
   <a class=h href="../">Pflame Home</a> <a class=h href="index.php">Praise Band Home</a><p>
   <center>
   <table border=1 cellpadding=3 cellspacing=0 width="97%"><tr>
   <td valign=top bgcolor="#ffffff" align=center>
   <div class=title>Praise Band Uploads</div>
   <div style='margin-top: 70px;'></div>
EOT;
    ssi_login('../praiseband/upload.php', 'echo');

echo <<<EOT
   <p style="margin-bottom:300px;">&nbsp;</p>
   </td></tr></table>
   </center>  </body></html>
EOT;
}

psychophat

I would also know how to do this . . . heheheh heh, I will try the code given to you and play with it. Maybe I can get lucky and make it work.

I'm just learning PHP from the people in this awesome forum so chances are they have a better solution we'll just have to wait for the proz to explain things to us.
I adore this forum, from zero PHP knowledge to +.1% per post
I'm going to get the charter member thinggy when I get to save some cash
SMF v.1.1RC2
PHP v.4.3.11

Advertisement: