I am getting an error with my login script:
Error:
Code: Warning: Cannot modify header information - headers already sent by (output started at /home/bucket/public_html/inc/config.php:7) in /home/bucket/public_html/checklogin.php on line 24
checklogin.php
<?php
include "inc/config.php";
// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM `admin` WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "accounts.php"
session_register("myusername");
session_register("mypassword");
header("location:accounts.php");
}
else
{
header( 'Location: accounts-login.php' ) ;
}
?>
Does anyone spot the problem?
Simpler method of getting variables from mysql
Hi Guys,I'm trying to streamline my CMS's code and as I was writing a new page it occured to me that there might be an easier way to get variables from a mysql query and that if anyone knew how to do
Insert numbers from Barcode scanner into online php page
I have a real big problem, Here is what I'm trying to do. I have a Intermec CN3 handheld computer that has a builtin scanner. We have built a website that manage our inventory. How? We have a simple
login page does not execute a else statement
I've created a login page using sessions.When an incorrect user name or password is entered then a custom messege error message apears.But if a correct user name and password is used then notthing
want to add a break after a certain amount of characters
i was wondering how to add a break in a blog post after a certain amount of characters... any idea on how to do this???this is the code i'm workig with<?php$connect =
Warning: mysql_num_rows() supplied argument is not a valid MySQL result resource
This may be simple I just may need another pair of eyes..When i get records back the below code works just fine, when I get 0 rows back it shows the warning below. As you can see I tried to code for
How to sum these output values
Hi
File upload issues
Hi Guys,Can anyone see any issues with this code:Code: $setImage= 'productimages/' . date(U) . $HTTP_POST_FILES['setImage']['name'][0];copy($HTTP_POST_FILES['setImage']['tmp_name'][0], $setImage);Its
Bit manipulation program with binary operations
My homework is to create a program to scan in and add binary numbers and print them like so
Using Microsoft Exchange Server with PHP
Hi,I wanted to know if its possible to fetch email attachments from the exchange server using php.I know its possible to read message using the source I found in an article here
shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just replaces the last one. please help!!Code: [Select]<!DOCTYPE html PUBLIC "-//W3C//DTD