login No idea whats Up

This is a discussion on "login No idea whats Up" within the PHP Forum section. This forum, and the thread "login No idea whats Up are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Aug 27th, 2007, 14:03
Highly Reputable Member
Join Date: Dec 2006
Location: Norwich
Posts: 721
Blog Entries: 4
Thanks: 6
Thanked 2 Times in 2 Posts
login No idea whats Up

PHP: Select all

<?php include('./Connections/Blogs.php'); ?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  
session_start();
}

$loginFormAction $_SERVER['PHP_SELF'];
if (isset(
$_GET['accesscheck'])) {
  
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset(
$_POST['textfield'])) {
  
$loginUsername=$_POST['textfield'];
  
$password=$_POST['textfield2'];
  
$MM_fldUserAuthorization "";
  
$MM_redirectLoginSuccess "/index.php";
  
$MM_redirectLoginFailed "/fail.php";
  
$MM_redirecttoReferrer true;
  
mysql_select_db($database_Blogs$Blogs);
  
  
$LoginRS__query=sprintf("SELECT UserName, UserPsswrd FROM users WHERE UserName='%s' AND UserPsswrd='%s'",
    
get_magic_quotes_gpc() ? $loginUsername addslashes($loginUsername), get_magic_quotes_gpc() ? $password addslashes($password)); 
   
  
$LoginRS mysql_query($LoginRS__query$Blogs) or die(mysql_error());
  
$loginFoundUser mysql_num_rows($LoginRS);
  if (
$loginFoundUser) {
     
$loginStrGroup "";
    
    
//declare two session variables and assign them
    
$_SESSION['MM_Username'] = $loginUsername;
    
$_SESSION['MM_UserGroup'] = $loginStrGroup;          

    if (isset(
$_SESSION['PrevUrl']) && true) {
      
$MM_redirectLoginSuccess $_SESSION['PrevUrl'];    
    }
    
header("Location: " $MM_redirectLoginSuccess );
  }
  else {
    
header("Location: "$MM_redirectLoginFailed );
  }
}
?>
Is giving me this error when someone logs in.
Quote:
Warning: Cannot modify header information - headers already sent by (output started at D:\Program Files\wamp\www\index.php:27) in D:\Program Files\wamp\www\login.php on line 37
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Aug 27th, 2007, 14:51
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: login No idea whats Up

Ive had that before. the php code had to start on line 1 on the page its used on.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Aug 28th, 2007, 10:24
Reputable Member
Join Date: Feb 2006
Location: London
Age: 26
Posts: 103
Thanks: 0
Thanked 1 Time in 1 Post
Re: login No idea whats Up

you can't have any output before you do your session_start function.
It needs to be right up the top of the page, or before any echo/print or html output

You are probably echoing or printing something in Connections/Blogs.php before trying to start the session.

If you're still having problems, post up the code for
Connections/Blogs.php

Cheers,
Jim.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Aug 28th, 2007, 10:26
Highly Reputable Member
Join Date: Dec 2006
Location: Norwich
Posts: 721
Blog Entries: 4
Thanks: 6
Thanked 2 Times in 2 Posts
Re: login No idea whats Up

thanks I fixed it by moving the login
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
login

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats going on here? Jack Franklin Webforumz Cafe 1 Feb 24th, 2008 19:37


All times are GMT. The time now is 06:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42