[advanced search]
Results from the most recent live auction are here.
17 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Domain Name Industry Newsletter
Go Back   NamePros.Com > Design and Development > Website Development
User Name
Password

Old 05-31-2007, 10:16 PM   · #1
johnny6
100buckdomains.com
 
Name: John
Location: North Carolina
Trader Rating: (85)
Join Date: Mar 2004
Posts: 2,017
NP$: 86.01 (Donate)
johnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant future
what am i doing wrong??? namebucks reward for help.

Can anyone tell me what I'm doing wrong? I'm trying to install cplinks on a website i'm revamping - spotlightsoccer.com As far as I can tell I followed the installation instructions exactly - http://www.cplinks.com/guide.html - however, when I try to log on or edit in the admin section - http://www.spotlightsoccer.com/admin/ - i get all sorts of errors like these -

SQL/DB Error -- [
Error selecting database spotligh_spotty!
Are you sure it exists?
Are you sure there is a valid database connection?
]

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/spotligh/public_html/includes/mysql.php:99) in /home/spotligh/public_html/admin/index.php on line 69

If anyone can fix this problem and tell me how they fixed it/what i did wrong, I'll give you 40 namebucks.

I'm baffled. Thanks,

John


Please register or log-in into NamePros to hide ads
__________________
www.discountcigaretteshop.com - Buy discount cigarettes
johnny6 is offline   Reply With Quote
Old 05-31-2007, 11:11 PM   · #2
CrazyTech
The Swamp Fox
 
CrazyTech's Avatar
 
Name: Denver
Location: Camden, SC
Trader Rating: (177)
Join Date: Oct 2004
Posts: 4,672
NP$: 1048.00 (Donate)
CrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond reputeCrazyTech has a reputation beyond repute
VA Tech Memorial
This is usually the most common problem for an error like this with clients, but did you remember to grant permissions for the user in the DB? I'm assuming you use cPanel because of the username, but I could be wrong. It's the most common oversight of all and that looks to be the issue.

If that doesn't work, verify that the db name, username, and password are all correct.
__________________
Denver Hunter | Customer Service Blog
Logically Connected to Idologic, Inc. | Coupon code to save 5%: denver
Reseller and Dedicated Web Hosting since 2001
Visit the web's best Christian Forum.
CrazyTech is offline   Reply With Quote
Old 06-01-2007, 01:00 PM   · #3
monaco
NamePros Regular
 
monaco's Avatar
 
Location: Tucson, AZ
Trader Rating: (0)
Join Date: Jul 2005
Posts: 649
NP$: 22.50 (Donate)
monaco is on a distinguished road
Originally Posted by johnny6
Can anyone tell me what I'm doing wrong? I'm trying to
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/spotligh/public_html/includes/mysql.php:99) in /home/spotligh/public_html/admin/index.php on line 69



This one is easy, you need to do things in a specific order on the page, and it looks like one of your includes is sending headers before the cookies have been sent.

Use the setcookie() function before you send any headers.
Use the header() function before you send any page text.
__________________
My Website | My Blog
monaco is offline   Reply With Quote
Old 06-01-2007, 04:28 PM   · #4
johnny6
100buckdomains.com
 
Name: John
Location: North Carolina
Trader Rating: (85)
Join Date: Mar 2004
Posts: 2,017
NP$: 86.01 (Donate)
johnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant future
I'm not sure it's either of these problems.... I appreciate the thoughts though. If anyone has an idea of how to fix it and wants to do it, I'll pay or something. please pme me.
__________________
www.discountcigaretteshop.com - Buy discount cigarettes
johnny6 is offline   Reply With Quote
Old 06-02-2007, 02:48 AM   · #5
phoenixd
NamePros Member
 
Trader Rating: (1)
Join Date: Jun 2007
Posts: 57
NP$: 91.40 (Donate)
phoenixd is an unknown quantity at this point
I think monaco is correct.cookie must be sent before the headers.Can u post the code ?
phoenixd is offline   Reply With Quote
Old 06-02-2007, 10:55 AM   · #6
johnny6
100buckdomains.com
 
Name: John
Location: North Carolina
Trader Rating: (85)
Join Date: Mar 2004
Posts: 2,017
NP$: 86.01 (Donate)
johnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant futurejohnny6 has a brilliant future
Originally Posted by phoenixd
I think monaco is correct.cookie must be sent before the headers.Can u post the code ?



Ok, that would be good if that's the problem - don't know how to fix it though. Here's the code for the file monaco pointed out.

////////////////////////////////// Start of functions ///////////////////////////

function user_set_tokens()
{
session_start();
$_SESSION['logged_in'] = "true";
}


function user_login( $admin_username, $password )
{
global $feedback;
global $db;

if ( !$admin_username || !$password )
{
return array('error' => true, 'error_msg' => "Incorrect Username or Password" );
}

$password = md5 ( strtolower ( $password ) );

$query = "SELECT admin_username FROM mnl_admin WHERE admin_username='$admin_username' AND admin_password= '$password'";
$user = $db->get_row( $query );
if ( $db->num_rows < 1 )
{
return array('error' => true, 'error_msg' => "User not found or Password incorrect" );
}

user_set_tokens();
return array('error' => false, 'error_msg' => "" );
}

////////////////////////////////// End of functions ///////////////////////////

require ( "../config.php" );
require ( "../includes/mysql.php" );

//Do not show the login form if the admin session exists
session_start();
if ( $_SESSION['logged_in'] == "true" )
{
header ( "location: admin_welcome.php" );
exit;
}

$mode = $_GET['mode'];

if ( $mode == "confirm" )
$admin_username = $_POST['admin_username'];
$password = $_POST['password'];
{
$result = user_login( $admin_username, $password );
if ( $result['error'] == false )
{
header ( "location: admin_welcome.php" );
exit;
}
}

require ( "admin_common.php" );
require ( "../global_config.php" );
require ( "admin_interface.php" );
require ( "admin_validate_form.php" );

$bgcolour = MAIN_COLOUR;

$header = "LOG IN HERE";

if ( $mode == "confirm" )
$admin_username = $_POST['admin_username'];
$password = $_POST['password'];
{
$result = user_login( $admin_username, $password );
if ( $result['error'] == false )
{
header ( "location: admin_welcome.php" );
exit;
}
}

admin_page_header();
echo "<p>&nbsp;</p>\n";
echo "<p>&nbsp;</p>\n";
echo "<form action=\"index.php?mode=confirm\" method=\"post\">";
echo "<table width=\"50%\" border=\"0\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#555555\" align=\"center\">\n";
echo "<tr bgcolor=\"$bgcolour\">\n";
echo "<td class=\"tbody\" colspan=\"2\" align=\"center\"><b>" . $header . "</b></td>\n";
echo "</tr>\n";

$bgcolour = "#FFFFFF";
$column1_width = "30%";
$column2_width = "70%";
$field_width = "35";

// The username
text_input( $bgcolour, "text", $column1_width, $column2_width, "<b>User name</b>", "admin_username", "", $field_width );

// The password
text_input( $bgcolour, "Password", $column1_width, $column2_width, "<b>Password</b>", "password", "", $field_width );

echo "<tr bgcolor=\"$bgcolour\">\n";
echo "<td class=\"tbody\" colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Log In\"></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";

admin_page_footer( $cplinks_version );
?>
__________________
www.discountcigaretteshop.com - Buy discount cigarettes
johnny6 is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Hunting Moon Website Header Design Website Header Design
Advertise your business at NamePros
All times are GMT -7. The time now is 11:18 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0