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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 27th, 2007, 14:03
simonb's Avatar
Blog Moderator

Join Date: Dec 2006
Location: Norwich
Posts: 675
Blog Entries: 4
Thanks: 4
Thanked 2 Times in 2 Posts
Send a message via Skype™ to simonb
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)
Reply With Quote

  #2 (permalink)  
Old Aug 27th, 2007, 14:51
SuperMember

SuperMember
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.
Reply With Quote
  #3 (permalink)  
Old Aug 28th, 2007, 10:24
Up'n'Coming Member
Join Date: Feb 2006
Location: London
Age: 25
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #4 (permalink)  
Old Aug 28th, 2007, 10:26
simonb's Avatar
Blog Moderator

Join Date: Dec 2006
Location: Norwich
Posts: 675
Blog Entries: 4
Thanks: 4
Thanked 2 Times in 2 Posts
Send a message via Skype™ to simonb
Re: login No idea whats Up

thanks I fixed it by moving the login
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
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
Whats up new here MattapanDee Introduce Yourself 5 Jan 26th, 2008 23:43
Whats going on?! Tyrtl Introduce Yourself 7 Sep 6th, 2007 18:20
Hi All Whats Up DarkwizarD Introduce Yourself 6 Jun 27th, 2007 07:15
Whats up jjgamepro17 Introduce Yourself 6 Nov 8th, 2006 14:48


All times are GMT. The time now is 11:40.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs 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 43