I have this script
<?php
/**
* @author Mike Simonds
* @copyright 2007
*/
session_start();
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
require_once ('./includes/SforcePartnerClient.php');
require_once ('./includes/SforceHeaderOptions.php');
require_once ('./includes/functions_sforce.php');
include ('header.inc');
$errors = null;
/**
* Checks to see if the user has submitted his
* username and password through the login form,
*/
if (isset($_POST['login']))
{
/* Check that all fields were typed in */
if (!$_POST['user'] || !$_POST['pass'])
{
global $errors;
$errors = ('Please fill in both username and password.');
}
else
{
/* Spruce up username, check length */
$_POST['user'] = trim($_POST['user']);
try
{
/* Checks that username and password are correct */
$result = login($_POST['user'], $_POST['pass']);
if (isset($result))
{
header( "Location: index.php" );
}
}
catch (exception $e)
{
print_r($e);
}
}
}
global $errors;
if (isset($errors))
{
echo '<p><span style=\"color:#FF0000\">$errors</span></p>';
}
?>
<div id="container">
<h3>Salesforce.com Login</h3>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<!--Begin Fieldset Container For Login-->
<fieldset>
<legend>Login</legend>
<div class="reqfield">
<label id="lbluname" for="username">Username:</label> <input name="user" id="username" class="textbox" type="text" title="Enter your username" />
</div>
<div class="reqfield">
<label id="lblpass" for="password">Password:</label> <input name="pass" id="password" class="textbox" type="password" title="Enter your password" />
</div>
<div class="reqfield" style="text-align: center;">
<br />
<input name="login" class="submit" value="Login" type="submit" />
</div>
</fieldset>
</form>
</div>
<?php
include ('footer.inc');
?>
and I am testing the login, but I am getting a header error because of the html in the header.inc, but I thought that if you checked the $result, you could use header() ?
Is there a way around this
TIA,
mike