Jump to content

Davecachia

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Davecachia's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks.. now all I have to do is get the validation to work
  2. Where does the echo go? and where would I put the " ; " Also, I am getting internal error 500 now. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Survey</title> </head> <body> <?php echo "Impact of Training Form: ";// READ IN DATA FROM HTML FORM ?> <?php if(!isset($_POST['process_form'])) { //Submit not pressed, show form! $showForm = true; } else { //Submit has been pressed. $showForm = false; //We'll default it at false if they submitted form. $error = false; //No errors yet if( isset( $_POST['process_form'] ) ) { $CompanyName = $_POST['CompanyName']; $IndustryType = $_POST['IndustryType']; $CompanySize = $_POST['CompanySize']; $ClassRoomTraining = $_POST['ClassRoomTraining']; $ClassRoomOrientation = $_POST['ClassRoomOrientation']; $ClassRoomManagerialOrSupervisoryTraining = $_POST['ClassRoomManagerialOrSupervisoryTraining']; $ClassRoomApprenticeshipTraining = $_POST['ClassRoomApprenticeshipTraining']; $ClassroomComputerHardware = $_POST['ClassRoomComputerHardware']; $ClassroomComputerSoftware = $_POST['ClassRoomComputerSoftware']; $ClassroomOtherOffice = $_POST['ClassRoomOtherOffice']; $ClassroomGroupDecisionMaking = $_POST['ClassRoomGroupDecisionMaking']; $ClassroomTeamBuilding = $_POST['ClassRoomTeamBuilding']; $ClassroomLiteracyOrNumeracy = $_POST['ClassRoomLiteracyOrNumeracy']; $TotalTrainingExpenditure = $_POST['TotalTrainingExpenditure']; $TrainersSalary =$_POST['TrainersSalary']; $TraineesSalary =$_POST['TraineesSalary']; $ContractsToVendors = $_POST['ContractsToVendors']; $DirectTuition = $_POST['DirectTuition']; $TrainingMaterials = $_POST['TrainingMaterials']; $TravelOrLivingCosts = $_POST['TravelorLivingCosts']; $Overhead = $_POST['Overhead']; $Other = $_POST['Other']; $WorkPlaceOrientation = $_POST['WorkPlaceOrientation']; $WorkPlaceManagerialOrSupervisoryTraining = $_POST['WorkPlaceManagerialOrSupervisoryTraining']; $WorkPlaceApprenticeshipTraining = $_POST['WorkPlaceApprenticeshipTraining']; $WorkPlaceComputerHardware = $_POST['WorkPlaceComputerHardwar']; $WorkPlaceComputerSoftware = $_POST['WorkPlaceComputerSoftware']; $WorkPlaceOtherOffice = $_POST ['WorkPlaceOtherOffice']; $WorkPlaceGroupDecisionMaking = $_POST ['WorkPlaceGroupDecisionMaking']; $WorkPlaceTeamBuilding = $_POST ['WorkPlaceTeamBuilding']; $WorkPlaceLiteracyOrNumeracy =$_POST['WorkPlaceLiteracyOrNumeracy']; $TotalAmountEmployees = $_POST ['TotalAmountEmployees']; /// Finished Here } } ?> <?php if($showForm) { <html> <form id="Survey" name="Survey" method="post" action="survey.php" form> <p>Please enter your company name: </p><p><label><font color="#ff0000">"*" Denotes a required answer</font></label></p> <p><label><strong><font color="#000000">Please enter your company name:</font></strong></label></p> <p><label><font color="#ff0000">* </font>1. Company Name: <input name="CompanyName" /> </label></p> <p><strong>Please select your industry type:</strong></p><label><font color="#ff0000">* </font>Industry Type <select name="IndustryType"> <option value="1" selected="selected">Select Industry..</option> <option value="2">Forestry, Mining, Oil, and Gas extraction</option> <option value="3">Finance and Insurance</option> <option value="4">Real estate, rental, and leasing ops</option> <option value="5">Business services</option> <option value="6">Education and health services</option> <option value="7">Information and cultural services</option> <option value="8">Labour intensive tertiary manufacturing</option> <option value="9">Primary product manufacturing</option> <option value="10">Secondary product manufacturing</option> <option value="11">Capital intensive tertiary manufacturing</option> <option value="14">Construction</option> <option value="15">Transportation, warehousing, wholesale</option> <option value="16">Communication and utilities</option> <option value="17">Retail trade and consumer services</option> <option value="18">None of the above</option></select> </label> <p><strong> </strong><font color="#ff0000">*</font><strong>Please select your company size: </strong></p><label><input type="radio" value="1" name="CompanySize" /> Small (less than 50 employees) </label> <p><label><input type="radio" value="2" name="CompanySize" /> Medium (between 50 and 250 employees) </label></p> <p><label><input type="radio" value="3" name="CompanySize" /> Large (greater than 250) </label><br /> </p> <p align="left"><strong>Class Room Training </strong></p> <p align="left">If your organization participated in Class Room Training, please indicate so by clicking the appropriate radio button. </p><label>Class Room Training</label> <input type="radio" value="1" name="ClassRoomTraining" /> <label>No Class Room Training</label> <input type="radio" value="2" name="ClassRoomTraining" /> <p><strong>Go to Question 2</strong></p> <p><strong>Your organization participates in Class Room Training. Please select those that apply: </strong></p><label><input type="checkbox" value="1" name="ClassRoomOrientation" /> Orientation for new Employees </label> <p><label><input type="checkbox" value="1" name="ClassRoomManagerialOrSupervisoryTraining" /> Managerial or Supervisory Training </label></p> <p><label><input type="checkbox" value="1" name="ClassRoomApprenticeshipTraining" /> Apprenticeship Training</label> </p> <p><label><input type="checkbox" value="1" name="ClassRoomComputerHardware" /> Computer Hardware </label></p> <p><label><input type="checkbox" value="1" name="ClassRoomComputerSoftware" /> Computer Software</label> </p> <p><label><input type="checkbox" value="1" name="ClassRoomOtherOffice" /> Other office and non-office equipment </label></p> <p><label><input type="checkbox" value="1" name="ClassRoomGroupDecisionMaking" /> Group decision-making or problem solving </label></p> <p><label><input type="checkbox" value="1" name="ClassRoomTeamBuilding" /> Team-building, leadership, communication</label> </p> <p><label><input type="checkbox" value="1" name="ClassRoomLiteracyOrNumeracy" /> Literacy or Numeracy </label></p> <p><strong>Please estimate the workplaces total training expenditure (in Dollars)</strong></p> <p><label>$ <input id="TotalTrainingExpenditure" name="TotalTrainingExpenditure" /> </label></p> <p><strong>Which of the following are included in the estimate?</strong></p> <p><label><input type="checkbox" value="1" name="TrainersSalary" /> Trainers' Salaries </label></p> <p><label><input type="checkbox" value="1" name="TraineesSalary" /> Trainees' Salaries </label></p> <p><label><input type="checkbox" value="1" name="ContractsToVendors" /> Contracts to vendors </label></p> <p><label><input type="checkbox" value="1" name="DirectTuition" /> Direct Tuition to schools or training institutions </label></p> <p><label><input type="checkbox" value="1" name="TrainingMaterials" /> Training materials </label></p> <p><label><input type="checkbox" value="1" name="TravelOrLivingCosts" /> Travel or living costs for trainees and trainers </label></p> <p><label><input type="checkbox" value="1" name="Overhead" /> Overhead or Office costs for training </label></p> <p><label><input type="checkbox" value="1" name="OtherTraining" /> Other training expenses </label></p> <p align="left"><strong>Work Place Training</strong></p> <p align="left">If your organization participated in Work Place Training, please indicate so by clicking the appropriate radio button. </p><label>Work Place Training </label><input type="radio" value="1" name="WorkPlaceTraining" /> <label>No Work Place Training</label> <input type="radio" value="2" name="WorkPlaceTraining" /> <br /> <p><strong>Your organization participates in Work Place Training. Please select those that apply:</strong></p><br /> <input type="checkbox" value="1" name="WorkPlaceOrientation" /> Orientation for new Employees </label> <p><label><input type="checkbox" value="1" name="WorkPlaceManagerialOrSupervisoryTraining" /> Managerial or Supervisory Training </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceApprenticeshipTraining" /> Apprenticeship Training </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceComputerHardware" /> Computer Hardware </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceComputerSoftware" /> Computer Software </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceOtherOffice" /> Other Office and non-office equipment </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceGroupDecisionMaking" /> Group Decision Making or Problem Solving </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceTeamBuilding" /> Team-building, leadership, communication </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceLiteracyOrNumeracy" /> Literacy or Numeracy </label></p> <p> </p> <p><strong>Please estimate the amount of employees that have had workplace training between April of last year and March of this year: </strong></p> <p><label><input id="TotalAmountEmployees" name="TotalAmountEmployees" /> </label></p><input type="submit" value="Submit the Form" name="process_form" /> <p> </p> <p> </p> </form> </html> } ?> </body> http://dcncs.net/survey.php
  3. Parse error: syntax error, unexpected '<' in /home2/dcncs/public_html/survey.php on line 76 I think it has to do something with the <html> and </html> in the form near the bottom - i've played around with the syntax and haven't got far. How's the if statements look?
  4. Hey guys. So i've mutilated my HTML form and merged into my PHP page.. i've got so many problems I do not even know where to start. I did what you guys suggested with the $showform bool, and started some sort of validations.. but I have a feeling alot of my stuff is not lining up and i've lost track of where the HTML Starts/Ends. I know there are probably tons of mistakes here.. if someone could take a look it would be great. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Survey</title> </head> <body> <?php echo "Impact of Training Form: ";// READ IN DATA FROM HTML FORM ?> <?php if(!isset($_POST['process_form'])) { //Submit not pressed, show form! $showForm = true; } else { //Submit has been pressed. $showForm = false; //We'll default it at false if they submitted form. $error = false; //No errors yet if( isset( $_POST['process_form'] ) ) { $CompanyName = $_POST['CompanyName']; $IndustryType = $_POST['IndustryType']; $CompanySize = $_POST['CompanySize']; $ClassRoomTraining = $_POST['ClassRoomTraining']; $ClassRoomOrientation = $_POST['ClassRoomOrientation']; $ClassRoomManagerialOrSupervisoryTraining = $_POST['ClassRoomManagerialOrSupervisoryTraining']; $ClassRoomApprenticeshipTraining = $_POST['ClassRoomApprenticeshipTraining']; $ClassroomComputerHardware = $_POST['ClassRoomComputerHardware']; $ClassroomComputerSoftware = $_POST['ClassRoomComputerSoftware']; $ClassroomOtherOffice = $_POST['ClassRoomOtherOffice']; $ClassroomGroupDecisionMaking = $_POST['ClassRoomGroupDecisionMaking']; $ClassroomTeamBuilding = $_POST['ClassRoomTeamBuilding']; $ClassroomLiteracyOrNumeracy = $_POST['ClassRoomLiteracyOrNumeracy']; $TotalTrainingExpenditure = $_POST['TotalTrainingExpenditure']; $TrainersSalary =$_POST['TrainersSalary']; $TraineesSalary =$_POST['TraineesSalary']; $ContractsToVendors = $_POST['ContractsToVendors']; $DirectTuition = $_POST['DirectTuition']; $TrainingMaterials = $_POST['TrainingMaterials']; $TravelOrLivingCosts = $_POST['TravelorLivingCosts']; $Overhead = $_POST['Overhead']; $Other = $_POST['Other']; $WorkPlaceOrientation = $_POST['WorkPlaceOrientation']; $WorkPlaceManagerialOrSupervisoryTraining = $_POST['WorkPlaceManagerialOrSupervisoryTraining']; $WorkPlaceApprenticeshipTraining = $_POST['WorkPlaceApprenticeshipTraining']; $WorkPlaceComputerHardware = $_POST['WorkPlaceComputerHardwar']; $WorkPlaceComputerSoftware = $_POST['WorkPlaceComputerSoftware']; $WorkPlaceOtherOffice = $_POST ['WorkPlaceOtherOffice']; $WorkPlaceGroupDecisionMaking = $_POST ['WorkPlaceGroupDecisionMaking']; $WorkPlaceTeamBuilding = $_POST ['WorkPlaceTeamBuilding']; $WorkPlaceLiteracyOrNumeracy =$_POST['WorkPlaceLiteracyOrNumeracy']; $TotalAmountEmployees = $_POST ['TotalAmountEmployees']; /// Finished Here } } ?> <?php if($showForm) { <html> <form id="Survey" name="Survey" method="post" action="survey.php" form> <p>Please enter your company name: </p><p><label><font color="#ff0000">"*" Denotes a required answer</font></label></p> <p><label><strong><font color="#000000">Please enter your company name:</font></strong></label></p> <p><label><font color="#ff0000">* </font>1. Company Name: <input name="CompanyName" /> </label></p> <p><strong>Please select your industry type:</strong></p><label><font color="#ff0000">* </font>Industry Type <select name="IndustryType"> <option value="1" selected="selected">Select Industry..</option> <option value="2">Forestry, Mining, Oil, and Gas extraction</option> <option value="3">Finance and Insurance</option> <option value="4">Real estate, rental, and leasing ops</option> <option value="5">Business services</option> <option value="6">Education and health services</option> <option value="7">Information and cultural services</option> <option value="8">Labour intensive tertiary manufacturing</option> <option value="9">Primary product manufacturing</option> <option value="10">Secondary product manufacturing</option> <option value="11">Capital intensive tertiary manufacturing</option> <option value="14">Construction</option> <option value="15">Transportation, warehousing, wholesale</option> <option value="16">Communication and utilities</option> <option value="17">Retail trade and consumer services</option> <option value="18">None of the above</option></select> </label> <p><strong> </strong><font color="#ff0000">*</font><strong>Please select your company size: </strong></p><label><input type="radio" value="1" name="CompanySize" /> Small (less than 50 employees) </label> <p><label><input type="radio" value="2" name="CompanySize" /> Medium (between 50 and 250 employees) </label></p> <p><label><input type="radio" value="3" name="CompanySize" /> Large (greater than 250) </label><br /> </p> <p align="left"><strong>Class Room Training </strong></p> <p align="left">If your organization participated in Class Room Training, please indicate so by clicking the appropriate radio button. </p><label>Class Room Training</label> <input type="radio" value="1" name="ClassRoomTraining" /> <label>No Class Room Training</label> <input type="radio" value="2" name="ClassRoomTraining" /> <p><strong>Go to Question 2</strong></p> <p><strong>Your organization participates in Class Room Training. Please select those that apply: </strong></p><label><input type="checkbox" value="1" name="ClassRoomOrientation" /> Orientation for new Employees </label> <p><label><input type="checkbox" value="1" name="ClassRoomManagerialOrSupervisoryTraining" /> Managerial or Supervisory Training </label></p> <p><label><input type="checkbox" value="1" name="ClassRoomApprenticeshipTraining" /> Apprenticeship Training</label> </p> <p><label><input type="checkbox" value="1" name="ClassRoomComputerHardware" /> Computer Hardware </label></p> <p><label><input type="checkbox" value="1" name="ClassRoomComputerSoftware" /> Computer Software</label> </p> <p><label><input type="checkbox" value="1" name="ClassRoomOtherOffice" /> Other office and non-office equipment </label></p> <p><label><input type="checkbox" value="1" name="ClassRoomGroupDecisionMaking" /> Group decision-making or problem solving </label></p> <p><label><input type="checkbox" value="1" name="ClassRoomTeamBuilding" /> Team-building, leadership, communication</label> </p> <p><label><input type="checkbox" value="1" name="ClassRoomLiteracyOrNumeracy" /> Literacy or Numeracy </label></p> <p><strong>Please estimate the workplaces total training expenditure (in Dollars)</strong></p> <p><label>$ <input id="TotalTrainingExpenditure" name="TotalTrainingExpenditure" /> </label></p> <p><strong>Which of the following are included in the estimate?</strong></p> <p><label><input type="checkbox" value="1" name="TrainersSalary" /> Trainers' Salaries </label></p> <p><label><input type="checkbox" value="1" name="TraineesSalary" /> Trainees' Salaries </label></p> <p><label><input type="checkbox" value="1" name="ContractsToVendors" /> Contracts to vendors </label></p> <p><label><input type="checkbox" value="1" name="DirectTuition" /> Direct Tuition to schools or training institutions </label></p> <p><label><input type="checkbox" value="1" name="TrainingMaterials" /> Training materials </label></p> <p><label><input type="checkbox" value="1" name="TravelOrLivingCosts" /> Travel or living costs for trainees and trainers </label></p> <p><label><input type="checkbox" value="1" name="Overhead" /> Overhead or Office costs for training </label></p> <p><label><input type="checkbox" value="1" name="OtherTraining" /> Other training expenses </label></p> <p align="left"><strong>Work Place Training</strong></p> <p align="left">If your organization participated in Work Place Training, please indicate so by clicking the appropriate radio button. </p><label>Work Place Training </label><input type="radio" value="1" name="WorkPlaceTraining" /> <label>No Work Place Training</label> <input type="radio" value="2" name="WorkPlaceTraining" /> <br /> <p><strong>Your organization participates in Work Place Training. Please select those that apply:</strong></p><br /> <input type="checkbox" value="1" name="WorkPlaceOrientation" /> Orientation for new Employees </label> <p><label><input type="checkbox" value="1" name="WorkPlaceManagerialOrSupervisoryTraining" /> Managerial or Supervisory Training </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceApprenticeshipTraining" /> Apprenticeship Training </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceComputerHardware" /> Computer Hardware </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceComputerSoftware" /> Computer Software </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceOtherOffice" /> Other Office and non-office equipment </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceGroupDecisionMaking" /> Group Decision Making or Problem Solving </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceTeamBuilding" /> Team-building, leadership, communication </label></p> <p><label><input type="checkbox" value="1" name="WorkPlaceLiteracyOrNumeracy" /> Literacy or Numeracy </label></p> <p> </p> <p><strong>Please estimate the amount of employees that have had workplace training between April of last year and March of this year: </strong></p> <p><label><input id="TotalAmountEmployees" name="TotalAmountEmployees" /> </label></p><input type="submit" value="Submit the Form" name="process_form" /> <p> </p> <p> </p> </form> </html> } ?> </body>
  5. Wait I think I understand now.. So first the user goes to the HTML form. Submits it.. If $error is triggered, you show the exact same form on the php file. Until the form is error free, it does not submit the values. Right?
  6. So. Instead of having the survey.html, I have all of that code in my PHP file? And that will work? I'm still a little confused though.
  7. Could you give me a hand. I'm not quite sure what you mean about having the code 'above' it? You guys mean in the header?
  8. So.. HTML form --> PHP FORM. Validation PHP side. IF Validation fails, feed PHP values back to HTML? Here's my code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Survey</title> </head> <body> <p>Impact of Training Form:</p> <p>Please enter your company name: </p> <form id="Survey" name="Survey" form action="survey.php" method="post" > <label>Company Name <input type="text" name="CompanyName" /> </label> <p><strong>Please select your industry type:</strong></p> <label>Industry Type <select name="IndustryType"> <option value="1">Select Industry..</option> <option value="2">Forestry, Mining, Oil, and Gas extraction</option> <option value="3">Finance and Insurance</option> <option value="4">Real estate, rental, and leasing ops </option> <option value="5">Business services </option> <option value="6">Education and health services</option> <option value="7">Information and cultural services </option> <option value="8">Labour intensive tertiary manufacturing </option> <option value="9">Primary product manufacturing </option> <option value="10">Secondary product manufacturing </option> <option value="11">Capital intensive tertiary manufacturing </option> <option value="14">Construction </option> <option value="15">Transportation, warehousing, wholesale </option> <option value="16">Communication and utilities </option> <option value="17">Retail trade and consumer services </option> <option value="18">None of the above </option> </select> </label> <p><strong>Please select your company size: </strong></p> <label> <input name="CompanySize" type="radio" value="1" /> Small (less than 50 employees) </label> <p> <label> <input name="CompanySize" type="radio" value="2" /> Medium (between 50 and 250 employees) </label> </p> <p> <label> <input name="CompanySize" type="radio" value="3" /> Large (greater than 250) </label> <br /> </p> <p align="left"><strong>Class Room Training </strong></p> <p align="left">If your organization participated in Class Room Training, please indicate so by clicking the appropriate radio button. </p> <label>Class Room Training</label> <input name="ClassRoomTraining" type="radio" value="1" /> <label>No Class Room Training</label> <input name="ClassRoomTraining" type="radio" value="2" /> <p><strong>Go to Question 2</strong></p> <p><strong> Your organization participates in Class Room Training. Please select those that apply: </strong></p> <label> <input type="checkbox" name="ClassRoomOrientation" value="1" /> Orientation for new Employees </label> <p> <label> <input type="checkbox" name="ClassRoomManagerialOrSupervisoryTraining" value="1" /> Managerial or Supervisory Training </label> </p> <p> <label> <input type="checkbox"name="ClassRoomApprenticeshipTraining" value="1"/> Apprenticeship Training</label> </p> <p> <label> <input type="checkbox" name="ClassRoomComputerHardware" value="1" /> Computer Hardware </label> </p> <p> <label> <input type="checkbox" name="ClassRoomComputerSoftware" value="1"/> Computer Software</label> </p> <p> <label> <input type="checkbox" name="ClassRoomOtherOffice" value="1" /> Other office and non-office equipment </label> </p> <p> <label> <input type="checkbox" name="ClassRoomGroupDecisionMaking" value="1" /> Group decision-making or problem solving </label> </p> <p> <label> <input type="checkbox" name="ClassRoomTeamBuilding" value="1" /> Team-building, leadership, communication</label> </p> <p> <label> <input type="checkbox" name="ClassRoomLiteracyOrNumeracy" value="1" /> Literacy or Numeracy </label> </p> <p><strong>Please estimate the workplaces total training expenditure (in Dollars)</strong></p> <p> <label>$ <input name="TotalTrainingExpenditure" type="text" id="TotalTrainingExpenditure" /> </label> </p> <p><strong>Which of the following are included in the estimate?</strong></p> <p> <label> <input type="checkbox" name="TrainersSalary" value="1" /> Trainers' Salaries </label> </p> <p> <label> <input type="checkbox" name="TraineesSalary" value="1" /> Trainees' Salaries </label> </p> <p> <label> <input type="checkbox" name="ContractsToVendors" value="1" /> Contracts to vendors </label> </p> <p> <label> <input type="checkbox" name="DirectTuition" value="1" /> Direct Tuition to schools or training institutions </label> </p> <p> <label> <input type="checkbox" name="TrainingMaterials" value="1" /> Training materials </label> </p> <p> <label> <input type="checkbox" name="TravelOrLivingCosts" value="1" /> Travel or living costs for trainees and trainers </label> </p> <p> <label> <input type="checkbox" name="Overhead" value="1" /> Overhead or Office costs for training </label> </p> <p> <label> <input type="checkbox" name="OtherTraining" value="1" /> Other training expenses </label> </p> <p align="left"><strong>Work Place Training</strong></p> <p align="left">If your organization participated in Work Place Training, please indicate so by clicking the appropriate radio button. </p> <label>Work Place Training </label> <input name="WorkPlaceTraining" type="radio" value="1" /> <label>No Work Place Training</label> <input name="WorkPlaceTraining" type="radio" value="2" /> <br> <p><strong>Your organization participates in Work Place Training. Please select those that apply:</strong></p> <br> <input type="checkbox" name="WorkPlaceOrientation" value="1" /> Orientation for new Employees </label> <p> <label> <input type="checkbox" name="WorkPlaceManagerialOrSupervisoryTraining" value="1" /> Managerial or Supervisory Training </label> </p> <p> <label> <input name="WorkPlaceApprenticeshipTraining" type="checkbox" value="1"/> Apprenticeship Training </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceComputerHardware" value="1" /> Computer Hardware </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceComputerSoftware" value="1"/> Computer Software </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceOtherOffice" value="1" /> Other Office and non-office equipment </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceGroupDecisionMaking" value="1" /> Group Decision Making or Problem Solving </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceTeamBuilding" value="1" /> Team-building, leadership, communication </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceLiteracyOrNumeracy" value="1" /> Literacy or Numeracy </label> </p> <p> <p> </p> <p><strong>Please estimate the amount of employees that have had workplace training between April of last year and March of this year: </strong></p> <p> <label> <input name="TotalAmountEmployees" type="text" id="TotalAmountEmployees" /> </label> </p> <input type="submit" name="process_form" value="Submit the Form" /> <p> </p> <p> </p> <p></p> </form> <p> </p> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Survey</title> </head> <body> <?php echo "Impact of Training Form: ";// READ IN DATA FROM HTML FORM ?> <?php if( isset( $_POST['process_form'] ) ) { $CompanyName = $_POST['CompanyName']; $IndustryType = $_POST['IndustryType']; $CompanySize = $_POST['CompanySize']; $ClassRoomTraining = $_POST['ClassRoomTraining']; $ClassRoomOrientation = $_POST['ClassRoomOrientation']; $ClassRoomManagerialOrSupervisoryTraining = $_POST['ClassRoomManagerialOrSupervisoryTraining']; $ClassRoomApprenticeshipTraining = $_POST['ClassRoomApprenticeshipTraining']; $ClassroomComputerHardware = $_POST['ClassRoomComputerHardware']; $ClassroomComputerSoftware = $_POST['ClassRoomComputerSoftware']; $ClassroomOtherOffice = $_POST['ClassRoomOtherOffice']; $ClassroomGroupDecisionMaking = $_POST['ClassRoomGroupDecisionMaking']; $ClassroomTeamBuilding = $_POST['ClassRoomTeamBuilding']; $ClassroomLiteracyOrNumeracy = $_POST['ClassRoomLiteracyOrNumeracy']; $TotalTrainingExpenditure = $_POST['TotalTrainingExpenditure']; $TrainersSalary =$_POST['TrainersSalary']; $TraineesSalary =$_POST['TraineesSalary']; $ContractsToVendors = $_POST['ContractsToVendors']; $DirectTuition = $_POST['DirectTuition']; $TrainingMaterials = $_POST['TrainingMaterials']; $TravelOrLivingCosts = $_POST['TravelorLivingCosts']; $Overhead = $_POST['Overhead']; $Other = $_POST['Other']; $WorkPlaceOrientation = $_POST['WorkPlaceOrientation']; $WorkPlaceManagerialOrSupervisoryTraining = $_POST['WorkPlaceManagerialOrSupervisoryTraining']; $WorkPlaceApprenticeshipTraining = $_POST['WorkPlaceApprenticeshipTraining']; $WorkPlaceComputerHardware = $_POST['WorkPlaceComputerHardwar']; $WorkPlaceComputerSoftware = $_POST['WorkPlaceComputerSoftware']; $WorkPlaceOtherOffice = $_POST ['WorkPlaceOtherOffice']; $WorkPlaceGroupDecisionMaking = $_POST ['WorkPlaceGroupDecisionMaking']; $WorkPlaceTeamBuilding = $_POST ['WorkPlaceTeamBuilding']; $WorkPlaceLiteracyOrNumeracy =$_POST['WorkPlaceLiteracyOrNumeracy']; $TotalAmountEmployees = $_POST ['TotalAmountEmployees']; /// Finished Here } ?> <br> Name: <?php echo $_POST["CompanyName"]; ?>.<br /> Industry Type: <?php echo $_POST["IndustryType"]; ?>.<br /> Company Size: <?php echo $_POST["CompanySize"]; ?>.<br /> ClassRoom Training: <?php echo $_POST["ClassRoomTraining"]; ?>.<br /> <br> ClassRoom Options Orientation: <?php echo $_POST["ClassRoomOrientation"]; ?>.<br /> Managerial or Supervisory Training: <?php echo $_POST["ClassRoomManagerialOrSupervisoryTraining"]; ?>.<br /> Apprenticeship Training: <?php echo $_POST["ClassRoomApprenticeshipTraining"]; ?>.<br /> Computer Hardware Training: <?php echo $_POST["ClassRoomComputerHardware"]; ?>.<br /> Computer Software Training: <?php echo $_POST["ClassRoomComputerSoftware"]; ?>.<br /> Other office and non office equipment: <?php echo $_POST["ClassRoomOtherOffice"]; ?>.<br /> Classroom Decision and Problem Solving: <?php echo $_POST["ClassRoomGroupDecisionMaking"]; ?>.<br /> Classroom Team Building: <?php echo $_POST["ClassRoomTeamBuilding"]; ?>.<br /> Classroom Literacy or Numeracy: <?php echo $_POST["ClassRoomLiteracyOrNumeracy"]; ?>.<br /> <br> Total Training Expenditure: <?php echo $_POST["TotalTrainingExpenditure"]; ?>.<br /> Trainers Salary: <?php echo $_POST["TrainersSalary"]; ?>.<br /> Trainees Salary: <?php echo $_POST["TraineesSalary"]; ?>.<br /> Vendor Contracts: <?php echo $_POST["ContractsToVendors"]; ?>.<br /> Direct Tuition: <?php echo $_POST["DirectTuition"]; ?>.<br /> Training Materials: <?php echo $_POST["TrainingMaterials"]; ?>.<br /> Travel or Living expenses: <?php echo $_POST["TravelOrLivingCosts"]; ?>.<br /> Overhead: <?php echo $_POST["Overhead"]; ?>.<br /> Other: <?php echo $_POST["Other"]; ?>.<br /> <br> Work Place Orientation: <?php echo $_POST["WorkPlaceOrientation"]; ?>.<br /> Work Place Managerial or Supervisory: <?php echo $_POST["WorkPlaceManagerialOrSupervisoryTraining"]; ?>.<br /> Work Place Apprenticeship Training: <?php echo $_POST["WorkPlaceApprenticeshipTraining"]; ?>.<br /> Work Place Computer Hardware: <?php echo $_POST["WorkPlaceComputerHardware"]; ?>.<br /> Work Place Computer Software: <?php echo $_POST["WorkPlaceComputerSoftware"]; ?>.<br /> Work Place Other Office: <?php echo $_POST["WorkPlaceOtherOffice"]; ?>.<br /> Work Place Group Decision Making: <?php echo $_POST["WorkPlaceGroupDecisionMaking"]; ?>.<br /> Work Place Team Building: <?php echo $_POST["WorkPlaceTeamBuilding"]; ?>.<br /> Work Place Literacy and Numeracy: <?php echo $_POST["WorkPlaceLiteracyOrNumeracy"]; ?>.<br /> Total Amount of Employees: <?php echo $_POST["TotalAmountEmployees"]; ?>.<br /> <p> <?php echo $CompanyName . "<br />"; echo $IndustryType . "<br />"; echo $CompanySize . "<br />"; ?> </p> </body> </html>
  9. Hey all. I've been posting here for a couple days.. some of you will already be familiar with my project. I'm at the data validation stage of the project. I am a strong C++ programmer so building the if statements and logic operations should not be difficult (it will just come down to PHP syntax errors). Where should I be doing validation? ON the HTML end or the PHP end? Right now my HTML form is complete. My PHP file is fed values, and the values are read into variables. If there is something wrong with their values, I want them to be able to finish what they've started (so that they don't have to re-fill the form if something was wrong. ALSO: Some questions being answered can have an impact on other questions.. so say you answered NO to question 1. Questions 2-5 might not be available. What is the best way to take care of this?
  10. It doesn't like this: <?php echo $CompanyName; echo $CompanySize; echo $IndustryType; ?> It will work with JUST company name, but if I put the other two in, it will not display Company name or any of them for that matter
  11. I have stuck with the original technique of recognising that the form was posted, other than that the problems were as I detailed in earlier posts. Rgds It was working for a minute.. I changed something that should have no bearing on that (just changed the wording of something and its not working again.) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Survey</title> </head> <body> <?php echo 'Impact of Training Form:';// READ IN DATA FROM HTML FORM ?> <?php if( isset( $_POST['process_form'] ) ) { $CompanyName = $_POST['CompanyName']; $IndustryType = $_POST['IndustryType']; $CompanySize = $_POST['CompanySize']; $ClassRoomTraining = $_POST['ClassRoomTraining']; $ClassRoomOrientation = $_POST['ClassRoomOrientation']; $ClassRoomManagerialOrSupervisoryTraining = $_POST['ClassRoomManagerialOrSupervisoryTraining']; $ClassRoomApprenticeshipTraining = $_POST['ClassRoomApprenticeshipTraining']; $ClassroomComputerHardware = $_POST['ClassRoomComputerHardware']; $ClassroomComputerSoftware = $_POST['ClassRoomComputerSoftware']; $ClassroomOtherOffice = $_POST['ClassRoomOtherOffice']; $ClassroomGroupDecisionMaking = $_POST['ClassRoomGroupDecisionMaking']; $ClassroomTeamBuilding = $_POST['ClassRoomTeamBuilding']; $ClassroomLiteracyOrNumeracy = $_POST['ClassRoomLiteracyOrNumeracy']; $TotalTrainingExpenditure = $_POST['TotalTrainingExpenditure']; $TrainersSalary =$_POST['TrainersSalary']; /// Finished Here } ?> Name: <?php echo $_POST["CompanyName"]; ?>.<br /> Industry Type: <?php echo $_POST["IndustryType"]; ?>.<br /> Company Size: <?php echo $_POST["CompanySize"]; ?>.<br /> ClassRoom Training: <?php echo $_POST["ClassRoomTraining"]; ?>.<br /> <br> ClassRoom Options Orientation: <?php echo $_POST["ClassRoomOrientation"]; ?>.<br /> Managerial or Supervisory Training: <?php echo $_POST["ClassRoomManagerialOrSupervisoryTraining"]; ?>.<br /> Apprenticeship Training: <?php echo $_POST["ClassRoomApprenticeshipTraining"]; ?>.<br /> Computer Hardware Training: <?php echo $_POST["ClassRoomComputerHardware"]; ?>.<br /> Computer Software Training: <?php echo $_POST["ClassRoomComputerSoftware"]; ?>.<br /> Other office and non office equipment: <?php echo $_POST["ClassRoomOtherOffice"]; ?>.<br /> Classroom Decision and Problem Solving: <?php echo $_POST["ClassRoomGroupDecisionMaking"]; ?>.<br /> Classroom Team Building: <?php echo $_POST["ClassRoomTeamBuilding"]; ?>.<br /> Classroom Literacy or Numeracy: <?php echo $_POST["ClassRoomLiteracyOrNumeracy"]; ?>.<br /> <br> Total Training Expenditure: <?php echo $_POST["TotalTrainingExpenditure"]; ?>.<br /> Trainers Salary: <?php echo $_POST["TrainersSalary"]; ?>.<br /> Trainees Salary: <?php echo $_POST["TraineesSalary"]; ?>.<br /> Vendor Contracts: <?php echo $_POST["ContractsToVendors"]; ?>.<br /> Direct Tuition: <?php echo $_POST["DirectTuition"]; ?>.<br /> Training Materials: <?php echo $_POST["TrainingMaterials"]; ?>.<br /> Travel or Living expenses: <?php echo $_POST["TravelOrLivingCosts"]; ?>.<br /> Overhead: <?php echo $_POST["Overhead"]; ?>.<br /> Other: <?php echo $_POST["Other"]; ?>.<br /> <br> Work Place Orientation: <?php echo $_POST["WorkPlaceOrientation"]; ?>.<br /> Work Place Managerial or Supervisory: <?php echo $_POST["WorkPlaceManagerialOrSupervisoryTraining"]; ?>.<br /> Work Place Apprenticeship Training: <?php echo $_POST["WorkPlaceApprenticeshipTraining"]; ?>.<br /> Work Place Computer Hardware: <?php echo $_POST["WorkPlaceComputerHardware"]; ?>.<br /> Work Place Computer Software: <?php echo $_POST["WorkPlaceComputerSoftware"]; ?>.<br /> Work Place Other Office: <?php echo $_POST["WorkPlaceOtherOffice"]; ?>.<br /> Work Place Group Decision Making: <?php echo $_POST["WorkPlaceGroupDecisionMaking"]; ?>.<br /> Work Place Team Building: <?php echo $_POST["WorkPlaceTeamBuilding"]; ?>.<br /> Work Place Literacy and Numeracy: <?php echo $_POST["WorkPlaceLiteracyOrNumeracy"]; ?>.<br /> Total Amount of Employees: <?php echo $_POST["TotalAmountEmployees"]; ?>.<br /> <?php echo $CompanyName; echo $CompanySize; echo $IndustryType; ?> </body> </html>
  12. Thanks I will give it a shot. Do you know what was wrong with it? And what further issues do you think are there?
  13. I've changed it to both GET and both POST and still no results. Changed the HTML code as well to <form id="Survey" name="Survey" form action="survey.php" method="post" > Still no results.
  14. No problem with the spaces there. The problem lies in the IF statement at the top as it is not reading in the variables. And because the if statements aren't being read, the variables are not being stored.
  15. <?php echo "TEST TEST TEST"; echo $CompanyName; echo $CompanySize; ?> The statements work. The values of $CompanyName and $CompanySize are null so they are not being reported - so it is still not successfully going through the if statement.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.