dbConfig.php
Code: <?
// Replace the variable values below
// with your specific database information.
$host = "localhost";
$user = "username";
$pass = "password";
$db = "annarbo1_Archives";
// This part sets up the connection to the
// database (so you don't need to reopen the connection
// again on the same page).
$ms = mysql_pconnect($host, $user, $pass);
if ( !$ms )
{
echo "Error connecting to database.n";
}
// Then you need to make sure the database you want
// is selected.
mysql_select_db($db);
?>
login.php
Code: <?php
// dBase file
include "dbConfig.php";
session_start();
if ($_GET["op"] == "login")
{
if (!$_POST["username"] || !$_POST["password"])
{
die("You need to provide a username and password.");
}
// Create query
$q = "SELECT * FROM `people` "
."WHERE `username`='".$_POST["username"]."' "
."AND `password`=PASSWORD('".$_POST["password"]."') "
."LIMIT 1";
// Run query
$r = mysql_query($q);
if ( $obj = @mysql_fetch_object($r) )
{
// Login good, create session variables
$_SESSION["valid_user"] = $_POST["username"];
// Redirect to member page
Header("Location: index.php");
}
else
{
// Login not successful
die("Sorry, could not log you in. Wrong login information.");
}
}
?>
when I run this online i get this error:
"Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home4/annarbo1/public_html/login.php:2) in /home4/annarbo1/public_html/login.php on line 4"
I have yet to figure out what's wrong
Using Curl_multi for processing multiple URLs
Hi,I am at a loss as to how to implement this. I would like to be able to automatically assign a number of urls taken from a file to x amount of curl_multi handles determined by the user on the form,
Greek characters in php
Hi,I'm making a script and I m using for first time greek characters.I started to write a simple drop down menu that loads some city names from the database. The names are in Greek in the database and
[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.If the program exits normally the port closes fine, however, if it crashes sometimes it remains open and I am unable to close it. The next time
how to insert value
I am having file bookissueadd.php..... in which i am having tag <td height="21">Issue Charges</td> <td><div
Significance of BPM
Hi Experts,
PHP FTP connect doesn't work with correct login
Hi!i am working on this test code:Quote<?php $ftp_server = "ftp.*******.it";$ftp_user = "weburl@*******.it";$ftp_pass = "CENSORED";// set up a
help with this code please?
Hello,I am trying to build a remote upload script for my image hosting site.I am using $_GET for testing purposes.this would be the url you would visit:Code:
Code doesn't print what i wanted it too. Please help!
Hi there,I wrote this code to mae it so that in the form before it that the user said their username and then on this page it matches up the username with the username on the database and then uses
$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable, but it doesn't work:Code: $test = array(1,2);$num = "[0]";echo $test{"$num"};
Page Reload
I am having issues getting a page to reload after I submit data to a database. This form should input data to a DB and then I want it to reload and list what is in database. I have gotten it to