I am in 1 program - a menu - and if the user has not entered any employees in the employees database yet I want to automatically jump the the program to add employees. I am having trouble jumping to that program. Here is my code:
<?
include 'DBConnection.php';
$result = mysql_query("SELECT from employees");
$Row=mysql_fetch_assoc($result);
$num_rows = mysql_num_rows($result);
// echo "Number of Rows=" . $num_rows;
if ($num_rows <= 0) {
header("Location: employees.php"); / Redirect browser /
/ Make sure that code below does not get executed when we redirect. */
exit;
}
?>
I have never been able to get the header command to work properly. I get:
Warning: Cannot modify header information - headers already sent by (output started at c:\employeesmenu.php:6)
Can you call a JavaScript function within a php function? I have never had problems linking to other pgms with JavaScript. If not how do you get the header command to work properly?
TIA
Frank