Beginner to PHP here. I'm designing a small website for an assignment with the goal of matching qualified job seekers with companies. The person looking for a job will fill out a form with their name, phone number, job they are looking for, college major, and the hours they wish to work. This information will be appended to a text file called "applicants.txt". Companies will fill out the same fields on a seperate page, except with what they are looking for in an employee as oppose to what they are looking for in a job. This information will be appended to a different text file called "jobOpenings.txt". I have done all of this successfully. What I am now struggling with is writing the PHP code to see if the information submitted by the job seeker matches the information submitted by the company.
-
1. Don't use $_REQUEST. Use the proper superglobal instead. 2. Do you ever read from applicants.txt?Major Productions– Major Productions2012年10月17日 01:45:45 +00:00Commented Oct 17, 2012 at 1:45
-
2Out of curiosity, do you not have access to a database system that you can use?Jon– Jon2012年10月17日 02:03:48 +00:00Commented Oct 17, 2012 at 2:03
-
Our teacher does not want us to use one since not everyone in class has experience using databases.Bryan– Bryan2012年10月17日 02:05:57 +00:00Commented Oct 17, 2012 at 2:05
1 Answer 1
For the problem that you posted, your error is in:
list($companyEmployer, $jobEmployer, $majorEmployer, $hoursEmployer) = explode("\t", $line);
You are trying to explode the data based on 'tabs', while when you save the data, you separate the entries by comma's. Change explode("\t", $line) to explode(",", $line) to correctly read the data in to your variables.