Jump to content

Help with IF statement


Davecachia

Recommended Posts

I am trying to read in my values from an HTML form into my PHP file.

Someone on the board gave me this if statement to work with:

 

if( isset( $_POST['process_form'] ) )

 

Now I assume 'process_form' must be the value of the submit button.

I am not sure what the isset means.

 

The submit button has the value 'process_form however, it is not running through my if statement.

 

Here's the 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" value="process_form" />

<p> </p>
<p> </p>
<p></p>
</form>

<p> </p>
</body>
</html>

 

and the PHP file..

<!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 = $_GET['CompanyName'];
   $IndustryType = $_GET['IndustryType'];
   $CompanySize = $_GET['CompanySize'];
   $ClassRoomTraining = $_GET['ClassRoomTraining'];
   $ClassRoomOrientation = $_GET['ClassRoomOrientation'];
   $ClassRoomManagerialOrSupervisoryTraining = $_GET['ClassRoomManagerialOrSupervisoryTraining'];
   $ClassRoomApprenticeshipTraining = $_GET['ClassRoomApprenticeshipTraining'];
   $ClassroomComputerHardware = $_GET['ClassRoomComputerHardware'];
   $ClassroomComputerSoftware = $_GET['ClassRoomComputerSoftware'];
   $ClassroomOtherOffice = $_GET['ClassRoomOtherOffice'];
   $ClassroomGroupDecisionMaking = $_GET['ClassRoomGroupDecisionMaking'];
   $ClassroomTeamBuilding = $_GET['ClassRoomTeamBuilding'];
   $ClassroomLiteracyOrNumeracy = $_GET['ClassRoomLiteracyOrNumeracy'];
   $TotalTrainingExpenditure = $_GET['TotalTrainingExpenditure'];
   $TrainersSalary =$_GET['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 />
<br>
Total Amount of Employees: <?php echo$_POST["TotalAmountEmployees"]; ?>.<br />

<?php
echo "TEST TEST TEST";
echo $CompanyName;
echo $CompanySize;
?>


</body>


</html>

 

Link to comment
Share on other sites

$_POST['process_form'] refers to an input field in your form named process_form, not with the value of 'process_form'

 

<input type="submit" value="process_form" />

needs to be

<input type="submit" name="process_form" value="Submit" />

 

Thanks for the help. I'll give it a whirl.

Link to comment
Share on other sites

$_POST['process_form'] refers to an input field in your form named process_form, not with the value of 'process_form'

 

<input type="submit" value="process_form" />

needs to be

<input type="submit" name="process_form" value="Submit" />

 

Changed it -

 

Still a no go.

Seems as if it is not running the IF statement because in the bottom area in the code I output "TEST TEST TEST". I am guessing the variables are null (surprised it doesn't crash when a variable is null like in most programming languages?).

 

Any other suggestions?

Link to comment
Share on other sites

Isset means "is this variable set" or "does this variable have a value".  The problem is, as your code stands you do not have a variable named process_form, so add in a name attribute:

 

 

<input type="submit" name="process_form" value="process_form" />

 

Note that your code is just asking "Does process_form have a value", so actually the value could be anything, i.e.

 

<input type="submit" name="process_form" value="1" />

 

should work too.  You could then change your main if statement to: 

 

if ($_POST['process_form'] == 1) {

 

if you want more readable code. 

 

Rgds

Link to comment
Share on other sites

Isset means "is this variable set" or "does this variable have a value".  The problem is, as your code stands you do not have a variable named process_form, so add in a name attribute:

 

 

<input type="submit" name="process_form" value="process_form" />

 

Note that your code is just asking "Does process_form have a value", so actually the value could be anything, i.e.

 

<input type="submit" name="process_form" value="1" />

 

should work too.  You could then change your main if statement to: 

 

if ($_POST['process_form'] == 1) {

 

if you want more readable code. 

 

Rgds

 

Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')' in /home2/dcncs/public_html/survey.php on line 14 when you change the submit button to value = 1

Link to comment
Share on other sites

OK, let's do it the way I would: 

 

Change your submit button back to this: 

 

<input type="submit" name="submit" value="Submit" />

 

Add this hidden field to the form: 

 

<input type="hidden" name="process_form" value="1">

 

Change your main If statement to:

 

If ($_POST['process_form'] == 1) {

 

This way the form processing is controlled by the hidden field. 

 

Rgds

 

 

Link to comment
Share on other sites

OK, let's do it the way I would: 

 

Change your submit button back to this: 

 

<input type="submit" name="submit" value="Submit" />

 

Add this hidden field to the form: 

 

<input type="hidden" name="process_form" value="1">

 

Change your main If statement to:

 

If ($_POST['process_form'] == 1) {

 

This way the form processing is controlled by the hidden field. 

 

Rgds

 

 

 

 

<?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.

Link to comment
Share on other sites

Also, the action type of your form is POST, so:

 

$CompanyName = $_GET['CompanyName'];

 

should be: 

 

$CompanyName = $_POST['CompanyName'];

 

Rgds

 

 

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.

Link to comment
Share on other sites

I have modified the files and tried them on my server and it is now producing some output.  There may be further issues with your code but hopefully this will give you some help: 

 

http://www.webref.eu/testing/survey.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>
<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>

 

 

 

 

http://www.webref.eu/testing/survey.php

 

<!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 />
<br>
Total Amount of Employees: <?php echo $_POST["TotalAmountEmployees"]; ?>.<br />

<?php
echo "TEST TEST TEST";
echo $CompanyName;
echo $CompanySize;
?>


</body>


</html>

Link to comment
Share on other sites

Do you know what was wrong with it? And what further issues do you think are there?

 

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.