i've tried require() and include(). but i get header errors when i try to use them (actions.php):
Code: Select all
<?
session_start();
if ($username == "") {
header("Location: index.html"); }
else {
require("config.php");
$id = $_GET['id'];
if ($id == "login")
{
$username = $_POST['username'];
$password = $_POST['password'];
$password = md5($password);
$c = mysql_connect("$host", "$user", "$pass");
$db = mysql_select_db("$db", "$c");
$q = "SELECT * FROM 'users' WHERE username = '$username' AND password = '$password'";
$r = mysql_query("$q", "$c");
$rws = mysql_num_rows($r);
if ($rws == "0")
{
echo "Login Incorrect! Please go back and try again";
}
else
{
session_register("username");
header("Location: admincp.php");
}
}
elseif ($id == "logout")
{
session_unregister("username");
session_unset();
header("Location: index.html");
}
} // end else
?>Code: Select all
Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site95/fst/var/www/html/nlogger/config.php:9) in /home/virtual/site95/fst/var/www/html/nlogger/actions.php on line 42Code: Select all
require("config.php");Code: Select all
header("Location: index.html");Code: Select all
$host = "localhost";
$user = "memememe";
$pass = "blablablablabla";
$db = "sinsrevival_com";
// the mysql variables
$dir_name = "/home/virtual/site21/fst/var/www/html/uploads";
$url_name = "http://www.sinsrevival.com/uploads";-Nay