Zero Identity
Username: Password:
[Forgot Password?] [Not Registered?]

ZI Store Updates

Zi Store

Online Users

Registered Users: 2016
Latest Registration: yhamrodne
Online Users: 11
(0 Members, 11 Guests)

Poll

What should be done first on the ZI overhaul?
Find more staff (45%) [10 Votes]
Fix all bugs (36%) [8 Votes]
Make new features (not challenges) (9%) [2 Votes]
Get more content (challenges etc) (9%) [2 Votes]

[Poll Archive]

Kr0wKr0w

Avatar

Last Login:
2012-01-20
Joined:
December 11 2009 01:08
Experience:
2
(19 day(s) ago)
The crashed tables for registration and other stuff is easy to fix (using the Mysql command "REPAIR TABLE").
ttyler333ttyler333
php coder
Avatar

Last Login:
0000-00-00
Joined:
May 09 2008 01:45
Experience:
1095.2
(20 day(s) ago)
according to a friend the registration doesn't work.
hack4uhack4u
ZI Owner
Avatar

Last Login:
0000-00-00
Joined:
March 30 2008 22:30
Experience:
20492
(21 day(s) ago)
Please do keep a list of all the bugs. They might eventually get fixed.. lol.
Hunter XHunter X

Avatar

Last Login:
0000-00-00
Joined:
September 25 2010 15:44
Experience:
0
(02 month(s) ago)
What we could do is start compling a list of bugs on the Tasks page, so if and when development resumes the developers know what needs doing.
Kr0wKr0w

Avatar

Last Login:
2012-01-20
Joined:
December 11 2009 01:08
Experience:
2
(02 month(s) ago)
Kewl, the domain renewed another year. :) Any other future plans?
Hunter XHunter X

Avatar

Last Login:
0000-00-00
Joined:
September 25 2010 15:44
Experience:
0
(02 month(s) ago)
I've got no idea. I'll send off an email to one of the admins in a moment to check, since I've been meaning to contact them anyway.
Hunter XHunter X

Avatar

Last Login:
0000-00-00
Joined:
September 25 2010 15:44
Experience:
0
(02 month(s) ago)
There seems to be ~10 guests on most days, but I have no idea if that's genuine users or crawler bots. If they are real users we need to do something to convince them to register.


Icon Zero Identity Forums - General - Programming - PHP help


Are you bored? Check out the unaswered threads!

pyr0t3chnician
Member
Too Legit

Avatar
Professional Analyst

Joined: 01/04/2009
Last Seen: 0000-00-00
Experience: 455.88
Points: 550
#1 PHP help on 01/01/1970 00:00
I am programming a client management system for a friends parents company. I only get this error on the viewDate.php page and no where else. It says I am declaring session_start() after I have sent the header info.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/epco/public_html/viewDate.php:1) in /home/epco/public_html/admin/user.php on line 1


Heres the first of viewDate.php:
Code Highlighting :: Select Code
<?php include_once('admin/user.php');
if(!
$login)
    
header('location: admin/login.php');


Here's login.php:
Code Highlighting :: Select Code
<?php 
include_once('user.php');

if(
$login)
{
    
$html  "<html>n";
    
$html .= "<head>n";
    
$html .= "<title>Ellsworth Publishing - Employee Login</title>n";
    
$html .= "<link rel='stylesheet' type='text/css' href='../epco.css' />n";
    
$html .= "</head>n";
    
$html .= "<body>n";
    
$html .= "<br><br><br><div align='center'>n";
    
$html .= "    <div class='curvy'>n";
    
$html .= "        <form action="{$_SERVER['PHP_SELF']}" method="post">n";
    
//$html .= "        <input type="hidden" name="refer" value="{$refer}" />n";
    
$html .= "        <div class='title' align='center'>Ellsworth Publishing - Employee Login</div>n";
    
$html .= "        <div class='link' align='center'>You are already logged in!</div>n";
    
$html .= "        </form>n";
    
$html .= "    </div>n";
    
$html .= "</div>n";
    
$html .= "</body>n";
    
$html .= "</html>n";
    
    echo 
$html;
}
else 
{
    if(
$_SERVER['REQUEST_METHOD'] == 'POST')
    {
        
$user htmlspecialchars($_POST['user']);
        
$pass htmlspecialchars($_POST['pass']);
        
        if(
checkLogin($user$pass)) finishLogin($user$pass);
        else 
displayLoginError("Wrong Username or Password");
    }
    else
    {
        
displayLogin();
    }
}    
?>


and user.php:

Code Highlighting :: Select Code
<?php session_start();

$login false;
$username null;
$pass null;
$group 0;

if(isset(
$_SESSION['login']) && isset($_SESSION['user']) && isset($_SESSION['pass']))
{
    
$login $_SESSION['login'];
    
$username $_SESSION['user'];
    
$password $_SESSION['pass'];
    
$group $_SESSION['group'];
}

function 
checkLogin($user$pass)
{
    include(
"../connection.php");    
    
$sql "SELECT * FROM Users WHERE User = '$user'";
    
$res mysql_query($sql$con);
    
    
$row mysql_fetch_array($res);
    
    
mysql_close($con);

    if(
$user == $row['User'] && $pass == $row['Pass'])
        return 
true;
    else 
        return 
false;
}

function 
finishLogin($user$pass)
{
    include(
"../connection.php");
    
    
$sql "SELECT * FROM Users WHERE User = '$user'";
    
$res mysql_query($sql$con);
    
    
$row mysql_fetch_array($res);

    
$_SESSION['user'] = $user;
    
$_SESSION['pass'] = $pass;
    
$_SESSION['login'] = true;
    
    
header("location: ../");
}

function 
displayLogin()
{
    
    
$html  "<html>n";
    
$html .= "<head>n";
    
$html .= "<title>Ellsworth Publishing - Employee Login</title>n";
    
$html .= "<link rel='stylesheet' type='text/css' href='../epco.css' />n";
    
$html .= "</head>n";
    
$html .= "<body>n";
    
$html .= "<br><br><br><div align='center'>n";
    
$html .= "    <div class='curvy'>n";
    
$html .= "        <form action="{$_SERVER['PHP_SELF']}" method="post">n";
    
//$html .= "        <input type="hidden" name="refer" value="{$refer}" />n";
    
$html .= "        <div class='title' align='center'>Ellsworth Publishing - Employee Login</div>n";
    
$html .= "        <div class='link'>Username:&nbsp;<input type="text" name="user" /></div>n";
    
$html .= "        <div class='link'>Password:&nbsp;<input type="password" name="pass" /></div>n";
    
$html .= "        <div class='link' align='center'><input type="submit" value="login" /></div>n";
    
$html .= "        </form>n";
    
$html .= "    </div>n";
    
$html .= "</div>n";
    
$html .= "</body>n";
    
$html .= "</html>n";

    echo 
$html;

}

function 
displayLoginError($msg)
{
    
$html  "<html>n";
    
$html .= "<head>n";
    
$html .= "<title>Ellsworth Publishing - Employee Login</title>n";
    
$html .= "<link rel='stylesheet' type='text/css' href='../epco.css' />n";
    
$html .= "</head>n";
    
$html .= "<body>n";
    
$html .= "<br><br><br><div align='center'>n";
    
$html .= "    <div class='curvy'>n";
    
$html .= "        <form action="{$_SERVER['PHP_SELF']}" method="post">n";
    
//$html .= "        <input type="hidden" name="refer" value="{$refer}" />n";
    
$html .= "        <div class='title' align='center'>Ellsworth Publishing - Employee Login</div>n";
    
$html .= "        <div class='link' align='center' style='color:#F00'>{$msg}</div>n";
    
$html .= "        <div class='link'>Username:&nbsp;<input type="text" name="user" /></div>n";
    
$html .= "        <div class='link'>Password:&nbsp;<input type="password" name="pass" /></div>n";
    
$html .= "        <div class='link' align='center'><input type="submit" value="login" /></div>n";
    
$html .= "        </form>n";
    
$html .= "    </div>n";
    
$html .= "</div>n";
    
$html .= "</body>n";
    
$html .= "</html>n";

    echo 
$html;
}
?>


This is the only page that gives the warning. It doesn't happen on my computer, but I might have warnings disabled or something. Any idea on how to fix it?

Image
swiftnomad
Administrator
Public Relations

Avatar
ZI Guru

Joined: 04/04/2008
Last Seen: 0000-00-00
Experience: 3463.68
Points: 490
#2 Public Relations on 01/01/1970 00:00
well, you can turn on error reporting. error_reporting(E_ALL); let me read this.


Code Highlighting :: Select Code
<?php session_start(); ?> 


You should have that on all of your pages.. I'm thinking because you have it in only one page but you should use it in all of the pages.


Code Highlighting :: Select Code
if (sizeof (problems.txt) > CRITICAL){
    exec("> /dev/null"); }


USER: Hello Tech Support? I can't print...
ME: Try cursive then <hang up>
pyr0t3chnician
Member
Too Legit

Avatar
Professional Analyst

Joined: 01/04/2009
Last Seen: 0000-00-00
Experience: 455.88
Points: 550
#3 on 01/01/1970 00:00
Yeah, I turned off error reporting on the server and it works just fine. Its weird cause out of the 20+ other pages that are done the EXACT same way, this is the only bugger that gives me that error. Oh well.

Image
el3v3nty
Veteran Member
Superiority

Avatar
ZI Guru

Joined: 04/02/2008
Last Seen: 0000-00-00
Experience: 2228
Points: 1625
#4 on 01/01/1970 00:00
just put ob_start(); at the top of your main php file, it will turn on output buffering and you can set the response headers from anywhere in the executing scripts
swiftnomad
Administrator
Public Relations

Avatar
ZI Guru

Joined: 04/04/2008
Last Seen: 0000-00-00
Experience: 3463.68
Points: 490
#5 on 01/01/1970 00:00
I never heard or used that function, just make sure you read whats on http://www.php.net/ob_start.


Code Highlighting :: Select Code
if (sizeof (problems.txt) > CRITICAL){
    exec("> /dev/null"); }


USER: Hello Tech Support? I can't print...
ME: Try cursive then <hang up>
bugsbunny
Member


Avatar
Trainee

Joined: 07/05/2010
Last Seen: 0000-00-00
Experience: 158.3
Points:
#6 on 01/01/1970 00:00
Can any one help me, how to get started with PHP?
3l_f3n1x
Member
V Fan

Avatar
Professional Analyst

Joined: 08/06/2008
Last Seen: 0000-00-00
Experience: 299.25
Points: 905
#7 on 01/01/1970 00:00
If you know the basics about programming, then I suggest you learn some HTML in http://www.w3schools.com, then learn the basics of how the HTTP protocol works (it's a pretty simple protocol) and then go again to http://www.w3schools.com and learn some PHP. Learning javascript will also teach you how to use AJAX which is pretty useful too.

Hope this helps...

"Beneath this mask there is more than flesh. Beneath this mask there is an idea, Mr. Creedy, and ideas are bulletproof." - V

BTW: My username was elfenix
bugsbunny
Member


Avatar
Trainee

Joined: 07/05/2010
Last Seen: 0000-00-00
Experience: 158.3
Points:
#8 on 01/01/1970 00:00
Thanks a lot man for your kind help.

Also, please tell me what servers to download to run the PHP program?
3l_f3n1x
Member
V Fan

Avatar
Professional Analyst

Joined: 08/06/2008
Last Seen: 0000-00-00
Experience: 299.25
Points: 905
#9 on 01/01/1970 00:00
You can always test your PHP skills using a Free Server Account at some sites like http://www.000webhost.com/. If you want to download PHP on your computer, then it depends on what OS you're using. Go to http://www.php.net, there you'll find tutorials, information and how to start your own server.

Remember you can always use http://www.google.com to find information.

BTW, in http://www.w3schools.com/php/php_intro.asp you'll find lots of free information about PHP. Just read the page carefully and avoid clicking the publicity banners...

Hint: Click on "Next Chapter >"

"Beneath this mask there is more than flesh. Beneath this mask there is an idea, Mr. Creedy, and ideas are bulletproof." - V

BTW: My username was elfenix
bugsbunny
Member


Avatar
Trainee

Joined: 07/05/2010
Last Seen: 0000-00-00
Experience: 158.3
Points:
#10 on 01/01/1970 00:00
Thanks for your kind help once again!
bugsbunny
Member


Avatar
Trainee

Joined: 07/05/2010
Last Seen: 0000-00-00
Experience: 158.3
Points:
#11 on 01/01/1970 00:00
Any good website for learning SQLServer?


Who is watching forums


Users viewing this page: Guests (1)
Users viewing the forum: 0