logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 07-10-2011, 03:32 PM   #1
theman68
 
Join Date: Mar 2011
Posts: 34
Default please please help me with this again

ok guys here goes
i have made a php inset on my website and on most pages i dont get this error but i get it at random
i can make my site on my local server and no problems what so ever
then i upload it to the net and then they start here is one

when i log out i get this error on one now

Warning: Cannot modify header information - headers already sent by (output started at /home/www/lirikwear.com/BundleBagNew/Products.php:247) in /home/www/lirikwear.com/BundleBagNew/php/allFunctions.php on line 32

code for both:

line 247: $totalPages_AllSellerProducts = ceil($totalRows_AllSellerProducts/$maxRows_AllSellerProducts)-1;

and that would be part of this code


$maxRows_AllSellerProducts = 20;
$pageNum_AllSellerProducts = 0;
if (isset($_GET['pageNum_AllSellerProducts'])) {
$pageNum_AllSellerProducts = $_GET['pageNum_AllSellerProducts'];
}
$startRow_AllSellerProducts = $pageNum_AllSellerProducts * $maxRows_AllSellerProducts;

$colname_AllSellerProducts = "-1";
if (isset($_GET['CategoryID'])) {
$colname_AllSellerProducts = (get_magic_quotes_gpc()) ? $_GET['CategoryID'] : addslashes($_GET['CategoryID']);
}
mysql_select_db($database_BundleBagNew, $BundleBagNew);
$query_AllSellerProducts = sprintf("SELECT * FROM allsellerproducts WHERE Catagory = %s ORDER BY MainSeq DESC", GetSQLValueString($colname_AllSellerProducts, "text"));
$query_limit_AllSellerProducts = sprintf("%s LIMIT %d, %d", $query_AllSellerProducts, $startRow_AllSellerProducts, $maxRows_AllSellerProducts);
$AllSellerProducts = mysql_query($query_limit_AllSellerProducts, $BundleBagNew) or die(mysql_error());
$row_AllSellerProducts = mysql_fetch_assoc($AllSellerProducts);

if (isset($_GET['totalRows_AllSellerProducts'])) {
$totalRows_AllSellerProducts = $_GET['totalRows_AllSellerProducts'];
} else {
$all_AllSellerProducts = mysql_query($query_AllSellerProducts);
$totalRows_AllSellerProducts = mysql_num_rows($all_AllSellerProducts);
}
$totalPages_AllSellerProducts = ceil($totalRows_AllSellerProducts/$maxRows_AllSellerProducts)-1;


then line 32 in allFunctions.php :

header("Location: $logoutGoTo");

which would be part of this

//////////////
$location = $row_Content['pageID'];

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);

$logoutGoTo = $location . ".php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}

then whether im signed in or not im always getting this error

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/lirikwear.com/BundleBagNew/Products.php on line 247

which is from the first code snippet i sent you guys

then when i sign in i get this

Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /home/www/lirikwear.com/BundleBagNew/php/allFunctions.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home/www/lirikwear.com/BundleBagNew/Products.php:247) in /home/www/lirikwear.com/BundleBagNew/php/allFunctions.php on line 70

didnt want to post it all cos its a lot of code but its my log in function made by dreamweaver. i have put the appropriate line numbers next the the problematic lines.

$LoginRS = mysql_query($LoginRS__query, $BundleBagNew) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;

(line 62) if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
(line 70) header("Location: ". $MM_redirectLoginFailed );
}
}

sorry for the long post ok guy well thank you load

the web site is: http://www.lirikwear.com/BundleBagNew/ and the problems are with the product pages thank you guys for your help

and i guess while im here i can ask does anyone know how to use the z-index property as you notice on the products page the log in drop down is beneath the tabbed panels ok thank guys
theman68 is offline   Reply With Quote
Old 07-14-2011, 04:45 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Are you echoing anything out before the first <html tag ?
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 07-15-2011, 01:20 AM   #3
theman68
 
Join Date: Mar 2011
Posts: 34
Default

no as far as what i know of and im pretty sure of it as i get nothing like this on my local server.
theman68 is offline   Reply With Quote
Old 07-15-2011, 01:38 AM   #4
theman68
 
Join Date: Mar 2011
Posts: 34
Default

hi david the answer is no mate i have just double checked and im echoing nothing outside of the html tag.
but just a qu for you
ive just read you site as that you posted also 'PHP Lesons here by me' and i really think your the guy i need help from
if i way you for lets say a 2 to 4 hour chat and send you my files so that you can really have a look and help me out with my problems and teach me why there are happening in the first place how much would you charge to help me out?
thank you
theman68 is offline   Reply With Quote
Old 07-15-2011, 06:39 AM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Its dreamweaver produced code

Im sorry but I don't touch that stuff
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 06:25 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com