hello!!
this is the error msg that i got:
Warning: Cannot add header information - headers already sent by (output started at Common/environmentVariables.php:28) in F:\wwwroot\job_connect\processStudentRegistration.php on line 26
but here is my source code for my environmentVariables.php file:
<?php
This php script contains all the environment variables of the
job connect web application
$DB_SERVER = "localhost";
$DB_USERNAME = "";
$DB_PASSWORD = "";
$DB_NAME = "job_connect";
# names of database tables
$companyProfile = "company_profile";
$country = "country";
$events = "events";
$forum = "forum";
$jobAdvertisement = "job_advertisement";
$jobCategory = "job_category";
$preferredCategory = "preferred_category";
$preferredService = "preferred_service";
$services = "services";
$staffProfile = "staff_profile";
$studentProfile = "student_profile";
?>
as your can see, there is no output statement..how come then the warning says ouput has been sent??
here's my source code for processStudentRegistration.php
<?php
This script processes the student registration form
require("Common/environmentVariables.php");
require("Common/mysql.openConnection.php");
# lock the tables that are going to be in used
$lockQuery = "LOCK TABLES $studentProfile READ";
# executing the query
mysql_query($lockQuery, $dbLink) or die("Invalid Query");
# check to see if there is in existence, a similar username, should a
# similar one exists, redirect user back to form page prompting them to
# change a username
$selectQuery = "SELECT * FROM $studentProfile WHERE userName='";
$selectQuery .= $student_id . "'";
# executing the query
$selectResult = mysql_query($selectQuery, $dbLink) or die("Invalid Query 2");
if(mysql_num_rows($selectResult) > 0)
{
# print("Account Exists");
header("Location: ../job_connect/registration.student.php?err=1");
die(); # stop execution of remaining script
}
# unlocking all locked tables
$unlockQuery = "UNLOCK TABLES";
# executing the query
mysql_query($unlockQuery, $dbLink) or die("Invalid Query");
# lock the tables that are going to be in used
$lockQuery = "LOCK TABLES $studentProfile WRITE";
# executing the query
mysql_query($lockQuery, $dbLink) or die("Invalid Query");
# lock table for inserting record
$insertQuery = "INSERT INTO $studentProfile(userName, pwd, firstName,";
$insertQuery .= " lastName, emailAddress, resumePath, aggressive) VALUES('";
$insertQuery .= $student_id . "', '" . $pwd . "', '" . $f_name . "', '";
$insertQuery .= $l_name . "', '" . $email_add . "', 'na', 'n')";
print($insertQuery);
# executing the query
mysql_query($insertQuery, $dbLink) or die("Invalid Query");
# unlocking all locked tables
$unlockQuery = "UNLOCK TABLES";
# executing the query
mysql_query($unlockQuery, $dbLink)or die("Invalid Query");
print("<h1>Thank you for registering</h1>");
?>
any help would be greatly appriciated..thanx!
yours sincerely
Javier