CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Guys help me

Print topic Send  topic

Author Message
princeqhaz12

Posts: 1
Posted: 03/15/2012, 1:00 AM

this is the code: is says Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /srv/disk5/870088/www/lagunachesscenter.sportsontheweb.net/control_panel/index.php:7) in /srv/disk5/870088/www/lagunachesscenter.sportsontheweb.net/control_panel/index.php on line 13

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login Page</title>
<link href="ajax/css/logincss.css" rel="stylesheet" type="text/css" /><br />
<link href="ajax/css/notification2.css" rel="stylesheet" type="text/css" />
<script src="ajax/scripts/jsrolloverimage.js" type="text/javascript"></script>

</head>
<body>

<div class="LCNT">
<div class="loginCONT">
<div class="imgTOP">CONTROL PANEL</div>


<form method="POST" action="index.php">
<table width="100%" style="font-family:verdana;font-size:12px;margin-top:15px;">
<tr>
<td style="width:20%;text-align:center;" >E-mail</td>
<td style="width:70%;"><input type="text" name="email" style="height:25px;width:95%; border:1px solid #A6DFF4;background:#F5F5F5;
-moz-border-radius:2px;-webkit-border-radius:3px;"/></td>
</tr>
<tr>
<td style="width:20;;text-align:center;">Password</td>
<td style="width:70%;"><input type="password" name="pword" style="height:25px;width:95%; border:1px solid #A6DFF4;background:#F5F5F5;
-moz-border-radius:2px;-webkit-border-radius:3px;"/></td>
</tr>

<td style="width:20%;"> </td>
<td style="width:70%;font-family:verdana;font-size:10px;"> <!--<a href="change_pw.php" class="forgotPW">
Forgot Password</a> --></td>
</tr>
<tr>
<td style="width:20%;"> </td>
<td style="width:70%;"></td></tr></table>


<input type="submit" name="logmein" class="bLOGn" value="" style="float:right;margin-right:15px;" />
</form>

<br />
<br />

<?php
session_start();
include('ajax/ajaxscript/phpscript/dbconnect.php');
if (isset($_POST['logmein']))
{
if ($_POST['email'] != '' || $_POST['pword'] !='')
{
//this code is for login
//anti sql injection
$user = mysql_real_escape_string($_POST['email']);
$pass = mysql_real_escape_string($_POST['pword']);
$result = mysql_query("SELECT * FROM tbl_useraccount
WHERE e_mail='". $user ."' AND p_word='". $pass ."'");
while($row = mysql_fetch_array($result)) {
$id = $row['id_n'];
$title = $row['title'];
$firstname = $row['f_name'];
$lastname = $row['l_name'];
$middlename = $row['m_name'];
$acclvl = $row['acc_lvl'];
$access = 'allowed';
if (mysql_num_rows($result)== 1){
$_SESSION['id'] = $id;
$_SESSION['title'] = $title;
$_SESSION['firstname'] = $firstname;
$_SESSION['middlename'] = $middlename;
$_SESSION['lastname'] = $lastname;
$_SESSION['accesslvl'] = $acclvl;
$_SESSION['acc'] = $access;
$_SESSION['icas_ses']= 'loggedin';

if($acclvl=='admin'){
echo'<script>document.location.href="ajax/"</script>';
//header("location:admin_page.php?deft=0&viewp=All&fold=");
}else{
echo'<script>document.location.href="ajax/"</script>';
//header("location:admin_page.php?deft=1&viewp=All&fold=");
}
break;
}
}

echo'<div class="error">Login Error! Check your Email/Password!</div>';
}
else if ($_POST['email'] == '' || $_POST['pword'] == '')
{
echo'<div class="warning">All fields are required!</div>';
}
}
?>
</div>
</div>


</body>
</html>
View profile  Send private message
cleyan


Posts: 136
Posted: 03/16/2012, 8:16 AM

this is not Codecharge code, you are mixin html and php code in the same file, this is not compatible with cmv

When you call session_start you already has sended a lot of code, this generate an error.

To call session_start or header(...) it must be first you send any content to the browser (seven spaces or \n )

I hope this help you


Best Regards


Carlos
_________________
**************************************************
Carlos Leyan B.
Temuco, Chile
www.leytec.net
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.