Home  | FAQ  | Search  | Memberlist  | Usergroups  | Register  | Profile  | Log in  | Log in for your private messages
Login Box & Register_Long_arrays Question

 
Post new topic   Reply to topic    myWebland Forum Index -> Customization
View previous topic :: View next topic  
Author Message
nattsumi
Newbie


Joined: 02 Jun 2006
Posts: 5

PostPosted: Fri Jun 02, 2006 4:40 am    Post subject: Login Box & Register_Long_arrays Question Reply with quote

Heya,

I have two questions: how can you put a working login box on the index page, and at the very bottom of the index page, there are links to view the previous 5 posts, can those be modified to work without turning on Register_Long_arrays? I don't have access to PHP.ini, because I am with a hosting company, 1and1.
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Fri Jun 02, 2006 6:39 am    Post subject: Reply with quote

create your own login script by duplicating & modifying the login.php
lets assumed we saved as loginindex.php

use include('loginindex.php"); & put that into your index.php script
Back to top
View user's profile Send private message Send e-mail
nattsumi
Newbie


Joined: 02 Jun 2006
Posts: 5

PostPosted: Fri Jun 02, 2006 6:55 am    Post subject: Reply with quote

Hmm, I worded my question wrong, hehe. I meant, how would I go about putting a working login box in the navigation area, like under the search area?
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Fri Jun 02, 2006 8:05 am    Post subject: Reply with quote

As what I said , you have to
a) duplicate the login.php file, modified it to fit into the sidemenu.
b) modify the index.php to put the login box into the sidemenu.

You may not understand how to do it if you do not know php
Back to top
View user's profile Send private message Send e-mail
nattsumi
Newbie


Joined: 02 Jun 2006
Posts: 5

PostPosted: Fri Jun 02, 2006 5:59 pm    Post subject: Reply with quote

Okay, so I got the actual login box form in the index file but every time I enter my login information, I get a 404 error.

Quote:
/%3C?%20echo%20$_SERVER['PHP_SELF']%20?%3E?mode=login


Can how you tell how much of the code from login.php I need to incorporate in to the index? I've tried pasting the whole thing, but then I get

Quote:
Parse error: parse error, unexpected $ in /homepages/7/d164514812/htdocs/index.php on line 246


Quote:
if (isset($_GET['mode'])) {
$mode = htmlspecialchars($_GET['mode']) ; }

// Security precaution - sean 07 Oct 2005
if (isset($_POST['username'])) {
$username=$_POST['username'];
} else $username="";


if (isset($_POST['passwd'])) {
$passwd = $_POST['passwd'];
} else $passwd = "";

$username = htmlspecialchars(rtrim(trim($username), "\\"));
$username = substr(str_replace("\\'", "'", $username), 0, 25);
$username = str_replace("'", "\\'", $username);

if( isset( $mode ) )
{
if( $mode == "login" )
{
$username = trim( $username );
$passwd = md5(trim( $passwd ));

if( $username == "" ) message( $lang['Error'] , $lang['Msg_enter_name'] );
if( $passwd == "" ) message($lang['Error'], $lang['Msg_enter_pass'] );
$result = mysql_query( "SELECT user FROM ".USER_TBL." WHERE user='$username'
AND password='$passwd'" ) or error( mysql_error() );
if( mysql_num_rows( $result ) != 1 ) {
?>
<head>
<title>Log In</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" title="<? echo $style ?>" href="templates/<? echo $style ?>/<? echo $style ?>" type="text/css" />
</head>
<body bgcolor="#FFFFFF" topmargin="5" leftmargin="5" marginheight="5" marginwidth="5" ><center>
<? message($lang['Error'],$lang['Msg_invalid_pass']) ; ?>
</body></html>
<? }
else
{
session_start();

$_SESSION['username'] = $username;
$_SESSION['passwd'] = $passwd;
header( "Location: ./admin.php" );
}
}

}
else
{

?>
Back to top
View user's profile Send private message
sean
Site Admin


Joined: 14 Jul 2004
Posts: 671

PostPosted: Sat Jun 03, 2006 12:12 am    Post subject: Reply with quote

please PM me the link to your site
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    myWebland Forum Index -> Customization All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
TNX?

Error. Page cannot be displayed. Please contact your service provider for more details. (12)




Powered by phpBB © 2001, 2005 phpBB Group
Contact Us