Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6879933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:54:35+00:00 2026-05-27T04:54:35+00:00

In the beginning, the script worked fine. I logged in, logged out, and was

  • 0

In the beginning, the script worked fine. I logged in, logged out, and was able to do that a number of times.

Now, I don’t know what’s happened. The page ends up blank and if it’s not entirely blank, it shows some html but doesn’t redirect. However, it’s logging me in because I can go directly to the page I’m supposed to be redirected to by typing it in the address bar without being bounced back to the login page (did that make sense)?

I get that it must be something about my session, but I don’t fully understand.

This is the login check script:

<?php
$host=""; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name=""; // Database name
$tbl_name=""; // Table name

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$uname=$_POST['uname'];
$pname=$_POST['pname'];

$uname = stripslashes($uname);
$pname = stripslashes($pname);
$uname = mysql_real_escape_string($uname);
$pname = mysql_real_escape_string($pname);

$sql="SELECT * FROM $tbl_name WHERE username='$uname' and password='$pname'";
$result=mysql_query($sql);

$count=mysql_num_rows($result);

if($count==1){
session_register("uname");
session_register("pname");
header("location:index.php");
echo " '<h2>Continue to the donor list</h2><br /><br />

            <div id="login-box-name">
                Return to the login screen?
            </div>

            <div id="login-box-field">
            </div>

            <div id="login-box-name2"><a href="index.php"><img src="images/continue-btn.png" /></a></div>

            <div id="login-box-field2">
            </div>

            <br />

            <span class="login-box-options">

            </span>

            <br />
            <br />' ";
}
else {
echo " '<h2>Wrong Username or Password</h2><br /><br />

            <div id="login-box-name">
                Return to the login screen?
            </div>

            <div id="login-box-field">
            </div>

            <div id="login-box-name2"><a href="login.php"><img src="images/return-btn.png" /></a></div>

            <div id="login-box-field2">
            </div>

            <br />

            <span class="login-box-options">

            </span>

            <br />
            <br />' ";
}
?>

These are the errors I’ve received:

[27-Nov-2011 17:52:59] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home4/folder/public_html/ccc/check.php:2) in /home4/folder/public_html/ccc/check.php on line 35

[27-Nov-2011 17:52:59] PHP Warning:  Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:54:36+00:00Added an answer on May 27, 2026 at 4:54 am

    Make sure that you do not have any code echo’d out before or after the php tags. One why I have learned to avoid that is to remove the final ?> tag if there is not going to be anything else after it or if the page is purely PHP. Doing so will help avoid any extra spaces after it which will cause that error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the beginning this worked fine: $ rake cucumber:all But then $ script/plugin install
I made a script before, that worked completely fine in PHP 5.2. But when
I created a script that requires selecting a beginning year then only displays years
<script type=text/javascript> var x = 0; //this occurs in the beginning of the page.
Is there a difference between the two examples below for beginning a Perl script?
I'm just beginning to learn python. I wrote an example script to test OOP
I'm writing a bash script, which does several things. In the beginning it starts
I have a script that writes to a named pipe and another that reads
Ealier I used function in a seperate file that could be call by script
I have a SQL script that is being executed in TOAD. Currently, I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.