can anyone tell me what is wrong?
my script ...
<link rel="stylesheet" href="surplus.css" type="text/css">
<?php
session_start();
$UserLoggedOn = $user;
$PasswordLoggedOn = $pwd;
// connect to database
include("connection.php");
// is the user a valid user?
$qry = "SELECT username,password FROM logon WHERE username= '$user' AND password= '$pwd'";
$result = mysql_query($qry,$link);
$rows = mysql_num_rows($result);
if ($rows==0)
// invalid user
{
echo "<font color=\"#FF0000\" size=\"3\" face=\"Arial\"><b>";
echo "<center>I AM SORRY YOUR USERNAME AND PASSWORD WERE NOT RECOGNISED - PLEASE TRY AGAIN!";
echo "</font></b></font>";
include ("logonShippingDetails.php");
}
else
// valid user
{
// has the user already added shipping details
$qry = "SELECT username,password FROM shipping_details WHERE username= '$user' AND password= '$pwd'";
mysql_query($qry,$link);
$result = mysql_query($qry,$link);
$row = mysql_fetch_row($result);
// echo $result; // test stub
// echo $row[0]; // test stub
// echo $row[1]; // test stub
if ($row==0)
// query failed - user not yet registered - display blank form
{
header ("Location: ShippingDetailsForm.php?user=$user&pwd=$pwd");
}
else
// query ok - user registered - display form for amendment
{
header ("Location: ShippingDetailsUpdate.php?user=$user&pwd=$pwd");
}
}
// close the database connection
mysql_close();
?>
and the errors ...
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /files/home3/callaway/surplus/ShippingDetails.php:3) in /files/home3/callaway/surplus/ShippingDetails.php on line 4
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /files/home3/callaway/surplus/ShippingDetails.php:3) in /files/home3/callaway/surplus/ShippingDetails.php on line 4
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /files/home3/callaway/surplus/ShippingDetails.php on line 14
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /files/home3/callaway/surplus/ShippingDetails.php on line 15