Jump to content

Recommended Posts

Hi, I created a form and the trying to forward it to testphp.php. However, it is forwarding but not displaying the score according to the drop down test. If I set any of drop down option to No, then 10 must minus from the total. However, the output is always zero irrespective of the input.

 

 



<html>
<head>
<title>Billing IE</title>


</head>
<body >
<form id="audit_billing_IE" name="audit_billing_IE" method="post" action="testphp.php">
       
<table>
<tr>
<td background-color="green"> Evaluator Name  </td>
<td> <input type="text" name=evaluator_name id="evaluator_name"/> </td>
</tr>

<tr>
<td> Agent Name </td>
<td> <input type="text" name=user_name id="user_name"/> </td>
</tr>

<tr>
<td> Processing Date </td>
<td>

<input type="text" name="processing_date" id="processing_date"/>
       
</td>
</tr>
<tr>
<td> Review Date </td>
<td colspan="3">

<input type="text" name="review_date" id="review_date"/>
       
</td>
</tr>

<tr>
<td> Contact ID </td>
<td colspan='3'> <input type="text" name=contact_ID id="contact_ID"/> </td>
</tr>

<tr>
<td> Voice/Non Voice </td>
<td colspan='3'> <input type="text" name=audit_type id="audit_type"/> </td>
</tr>

<tr>
<td> A/C #/Case # </td>
<td colspan='3'> <input type="text" name=case_no id="case_no"/> </td>
</tr>

<tr>
<td> Product </td>
<td colspan='3'> <input type="text" name=product_name1 id="product_name"/> </td>
</tr>

<tr>
<td> Call duration</td>
<td colspan='3'> <input type="text" name=product_name2 id="product_name"/> </td>
</tr>

<tr>
<td> Errors </td>
<td colspan='3'> <input type="text" name=product_name3 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter A </td>
<td colspan='3'> <input type="text" name=product_name4 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter B </td>
<td colspan='3'> <input type="text" name=product_name5 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter C </td>
<td colspan='3'> <input type="text" name=product_name6 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter D </td>
<td colspan='3'> <input type="text" name=product_name7 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter E </td>
<td colspan='3'> <input type="text" name=product_name8 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter F </td>
<td colspan='3'> <input type="text" name=product_name9 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter G </td>
<td colspan='3'> <input type="text" name=product_name10 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter H </td>
<td colspan='3'> <input type="text" name=product_name11 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter I </td>
<td colspan='3'> <input type="text" name=product_name12 id="product_name"/> </td>
</tr>

<tr>
<td> Parameter J </td>
<td colspan='3'> <input type="text" name=product_name13 id="product_name"/> </td>
</tr>


<tr>
<td> Total Possible Points for Audit </td>
<td colspan='3'> <input type="text" name=product_name14 id="product_name"/> </td>
</tr>

<tr>
<td> Total Points Obtained for the Audit </td>
<td colspan='3'> <input type="text" name=product_name15 id="product_name"/> </td>
</tr>

<tr>
<td> Assessment Score </td>
<td colspan='3'> <input type="text" name=product_name16 id="product_name"/> </td>
</tr>

<tr align="centre">
<th> <span style="color:white" BGcolor="Blue"><b> PARAMETERS </span> </th>
<th>  <span style="color:white"><b> TOGGLE </span> </th>
<th>  <span style="color:white"><b> COMMENTS </span></th>
<th>  <span style="color:white"><b> SCORES </span> </th>
</tr>

<tr>
<td colspan="4" bgcolor="CCCC66" align="left"> <b> A. Credit approval </b> </td>
</tr>

<tr>
<td> Procedure </td>
<td>
<select name=Para_A_A1 id = "Para_A_A1" align="center">
<option value="Yes"> Yes </option>
<option value="No"> No </option>
<option value="NA"> NA </option>

</select>
</td>

<td >
<input type="text" name=Para_A_A1_comment id="Para_A_A1_comment"/>
</td>

<td align="center"> <input type="text" name=Para_A_A1_score id="Para_A_A1_score"/>
</td>
</tr>

<tr>
<td> Days Calculation (Service issue case)</td>
<td>
<select name=Para_A_A2 id = "Para_A_A2" align="center">
<option value="Yes"> Yes </option>
<option value="No"> No </option>
<option value="NA"> NA </option>

</select>
</td>

<td >
<input type="text" name=Para_A_A2_comment id="Para_A_A2_comment"/>
</td>

<td> <input type="text" name=Para_A_A2_score id="Para_A_A2_score"/>
</td>
</tr>

<tr>
<td> Credit request </td>
<td>
<select name=Para_A_A3 id = "Para_A_A3" align="center">
<option value="Yes"> Yes </option>
<option value="No"> No </option>
<option value="NA"> NA </option>

</select>
</td>

<td >
<input type="text" name=Para_A_A3_comment id="Para_A_A3_comment"/>
</td>

<td> <input type="text" name=Para_A_A3_score id="Para_A_A3_score"/>
</td>
</tr>

<tr>
<td> closure </td>
<td>
<select name=Para_A_A4 id = "Para_A_A4" align="center">
<option value="Yes"> Yes </option>
<option value="No"> No </option>
<option value="NA"> NA </option>

</select>
</td>

<td >
<input type="text" name=Para_A_A4_comment id="Para_A_A4_comment"/>
</td>

<td> <input type="text" name=Para_A_A4_score id="Para_A_A4_score"/>
</td>
</tr>

<tr>
<td> Comments / interaction </td>
<td>
<select name=Para_A_A5 id = "Para_A_A5" align="center">
<option value="Yes"> Yes </option>
<option value="No"> No </option>
<option value="NA"> NA </option>

</select>
</td>

<td >
<input type="text" name=Para_A_A5_comment id="Para_A_A5_comment"/>
</td>

<td> <input type="text" name=Para_A_A5_score id="Para_A_A5_score"/>
</td>
</tr>

<tr>
<td> TEXT updation </td>
<td>
<select name=Para_A_A6 id = "Para_A_A6" align="center">
<option value="Yes"> Yes </option>
<option value="No"> No </option>
<option value="NA"> NA </option>

</select>
</td>

<td >
<input type="text" name=Para_A_A6_comment id="Para_A_A6_comment"/>
</td>

<td> <input type="text" name=Para_A_A6_score id="Para_A_A6_score"/>
</td>
</tr>


<tr>
   

<td> <input name="submit" type="submit" id="submit" value="Submit Details" />
<input name="Reset" type="reset" value="Reset">
</td>
</tr>
</div>

</table>

</form>
</div>
</div>
</body>
</html>

 

 

Below is the testphp.php

 

 



<?php
    $question1 = $_POST['Para_A_A1'];
    $question2 = $_POST['Para_A_A2'];
    $question3 = $_POST['Para_A_A3'];
    $question4 = $_POST['Para_A_A4'];
    $question5 = $_POST['Para_A_A5'];
    $question6 = $_POST['Para_A_A6'];
   
    {
    $numberofansweredquestions = 0;
    $score = 0;

    if ($question1 == "YES")
    {
         $numberofansweredquestions++;
         $score += 10;
    }
    else
        if
            ($question1 == "NO")
    {
         $numberofansweredquestions++;
    }

    if ($question2 == "YES")
    {
         $numberofansweredquestions++;
         $score += 10;
    }
    else
        if
            ($question2 == "NO")
    {
         $numberofansweredquestions++;
    }
   
     if ($question3 == "YES")
    {
         $numberofansweredquestions++;
         $score += 10;
    }
    else
        if
            ($question3 == "NO")
    {
         $numberofansweredquestions++;
    }
   
     if ($question4 == "YES")
    {
         $numberofansweredquestions++;
         $score += 10;
    }
    else
        if
            ($question4 == "NO")
    {
         $numberofansweredquestions++;
    }
   
     if ($question5 == "YES")
    {
         $numberofansweredquestions++;
         $score += 10;
    }
    else
        if
            ($question5 == "NO")
    {
         $numberofansweredquestions++;
    }
   
     if ($question6 == "YES")
    {
         $numberofansweredquestions++;
         $score += 10;
    }
    else
        if
            ($question6 == "NO")
    {
         $numberofansweredquestions++;
    }
   
    $maxscore = $numberofansweredquestions * 10;
    echo "The score is: " . $score . "/" . $maxscore . "";
   
    }
   
    ?>





Link to comment
https://forums.phpfreaks.com/topic/245419-form-forward-not-working-help/
Share on other sites

Yes. but let me explain you. If the question one is set to YES, then the numberofansweredquestion is 1. if question 2 is set to yes, the again numberofansweredquestion  will be 2 and maxscore will be 20. If I set the third question to NO, then numberofansweredquestion should be 3 but maxscore should remain 20.

 

However, my code is not generating the maxscore. It will always display 0 whatever the input for questions.

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.