Page 1 of 1

$_POST an Array

Posted: Wed Aug 20, 2014 10:35 pm
by langleyv
Again, sorry to ask such a stupid questions, but I can't seem to find how to structure $_POST to allow an array from a "submitted page" to be usable in the current php file.

if I have a multi-dimensional array called $DataToPost[] in a form page, how would I reference that same information in the " processor.php" file ?

$testpost=[];
$testpost = $_POST['DataToPost[]']; - does not seem to work.
$testpost = $_POST['DataToPost']; - this one neither

Even pointing me to some reference would help.

Thanks

Re: $_POST an Array

Posted: Wed Aug 20, 2014 11:00 pm
by Weirdan
Post your form's html code.

Re: $_POST an Array

Posted: Thu Aug 21, 2014 5:47 am
by langleyv
Sorry. Here is the code relating to the array.

Code: Select all

$DataToPost = [];
while ($row = mysql_fetch_array($rs)) {
    $count = $i+1;
    
    $surQ        = $row['qu_text'];
    $surQ_number = trim($row['qu_Survey_Q_number']);
    $surMinLabel = $row['qu_bottom_label'];
    $surMaxLabel = $row['qu_top_label'];
    $showScale   = trim($row['qu_scale_visible']);
    
    $questionGroup = $row['q_Q_Group'];
   
        $DataToPost[] = array($Dealer_ID,$Survey_num,$surQ_number,"GUID",$surQ,$questionGroup,$showScale,$surMaxLabel);

    $i++;

Re: $_POST an Array

Posted: Thu Aug 21, 2014 7:19 am
by Celauran
That shows how the array is being constructed but not how it's being sent through the POST request. Are you injecting this into a form? How?

Re: $_POST an Array

Posted: Sat Aug 23, 2014 4:03 pm
by langleyv
Sorry, here it is. It is a form with a standard SUBMIT. Lots of code here, and I know it is not elegant, but it has been a while since I looked at it, and just need to get a demo working prior to re-writing and getting back into programming in a more consistent way. Thanks for all your help.

Code: Select all

<?php 

error_reporting();
//* used to process request */
    // allow the php to use long file info, and to allow includes
    
ini_set('allow_url_include', 1);
ini_set('allow_url_fopen', 1);
include 'dbdata2.php';


session_start();


  
    
 // Company information **********************[STEP ONE]*****************************************************************
//$company_ID = $_GET["coID"];

//$strSQL1 = "SELECT * FROM t_company WHERE co_ID = '".$company_ID."'";
//$rs = mysql_query($strSQL1);

$coName="Town+Country Volkswagen"; //$row['co_name'];
$coLogo=$row['co_logo'];
$coLogo="http://www.qr-vue.com/DEMO/logos/town+countryVW.jpg"; //.$coLogo ;
	$img = @imagecreatefrompng($coLogo);
  	$myLogoH = imagesy($img);  //get the height of the image
  	$ratio=$myLogoH / 25 ;
  	$NewW=imagesx($img) / $ratio;
    
$surIntro=$row['co_intro_text']; 
   
$surEmailText= $row['co_contact_text'];        //text to ask for email
$surThankYou= $row['co_footer_text'];        // Thank you text

    //HEADER *********************************HEADER ****************************************************************

print"<html> 
<head>
 
    <title>".$coName."</title> 
	
    <meta name='viewport' content='width=device-width, initial-scale=1'> 
<link rel='stylesheet' href='http://demo.qr-vue.com/jquerymobile/jquery.mobile-1.1.0.min.css' />
    <script type='text/javascript' src='http://demo.qr-vue.com/jquerymobile/jquery-1.7.min.js'></script>
    <script type='text/javascript' src='http://demo.qr-vue.com/jquerymobile/jquery.mobile-1.1.0.min.js'></script>

<style type='text/css'>
.leftlabelalign {
	text-align: left;
	position: absolute;
	left: 15px;
}
.rightlabelalign {
	text-align: right;
	position: absolute;
	right: 15px;
}
</style>

</head> 

<body>

<form id='fMain' method='post' action='insert2.php' data-ajax='false' >
    <div data-role='page'data-theme='b'>";


print"
    <div data-role='header'>
        <h1><img src='".$coLogo."' width='".$newW."' height='25'</h1>
		<h3>".$coName."</h3>
    </div><!-- /header -->

    <div data-role='content'>    
        <p>".$surIntro."</p> 
    <p>".$newW."</p>";
    
	
	
	//*********************************** get GUID
    //HEADER DONE *************************************HEADER DONE ********************************************************;
$survey_ID = $_GET["suID"];
print"<input type = 'hidden' name = 'sur_ID' value = '".$survey_ID."'>";
$strSQL = "SELECT * FROM `t_Questions` WHERE qu_Survey_ID = '".$survey_ID."' ORDER BY RAND() LIMIT 5";
$rs = mysql_query($strSQL);

$i=0;

while ($row= mysql_fetch_array($rs))
{
	$count=$i+1;
	$surQ = $row['qu_text'];
	$surQ_number = trim($row['qu_Survey_Q_number']);
	$surMinLabel = $row['qu_bottom_label'];
	$surMaxLabel = $row['qu_top_label'];
	$showScale = $row['qu_scale_visible'];
	$showScale = trim($showScale);
	
	$questionGroup=$row['q_Q_Group'];
	
	
	
	
	switch ($count) {
    case 1:
        print"<input type = 'hidden' name = 'Q1txt' value = '".$surQ."'>";
		print"<input type = 'hidden' name = 'Q1_Q_num' value = '".$surQ_number."'>"; // the question number within the survey
		print"<input type = 'hidden' name = 'Q1_G_num' value = '".$questionGroup."'>"; //the Group of the question
		if($showScale == "N") {
		print"<input type = 'hidden' name = 'Q1txt' value = '".$surQ."-".$surMaxLabel."'>"; // the max label 
		}
		break;
		break; 
    case 2:
        print"<input type = 'hidden' name = 'Q2txt' value = '".$surQ."'>";
        print"<input type = 'hidden' name = 'Q2_Q_num' value = '".$surQ_number."'>";
		print"<input type = 'hidden' name = 'Q2_G_num' value = '".$questionGroup."'>";
		if($showScale == "N") {
		print"<input type = 'hidden' name = 'Q2_Scale_Top' value = '".$surQ."-".$surMaxLabel."'>";
		}
		break;
		break;
    case 3:
        print"<input type = 'hidden' name = 'Q3txt' value = '".$surQ."'>";
        print"<input type = 'hidden' name = 'Q3_Q_num' value = '".$surQ_number."'>";
		print"<input type = 'hidden' name = 'Q3_G_num' value = '".$questionGroup."'>";
		if($showScale == "N") {
		print"<input type = 'hidden' name = 'Q3_Scale_Top' value = '".$surQ."-".$surMaxLabel."'>";
		}
		break;
		break;
	case 4:
        print"<input type = 'hidden' name = 'Q4txt' value = '".$surQ."'>";
        print"<input type = 'hidden' name = 'Q4_Q_num' value = '".$surQ_number."'>";
		print"<input type = 'hidden' name = 'Q4_G_num' value = '".$questionGroup."'>";
		if($showScale == "N") {
		print"<input type = 'hidden' name = 'Q4_Scale_Top' value = '".$surQ."-".$surMaxLabel."'>";
		}
		break;
		break;
	case 5:
        print"<input type = 'hidden' name = 'Q5txt' value = '".$surQ."'>";
        print"<input type = 'hidden' name = 'Q5_Q_num' value = '".$surQ_number."'>";
		print"<input type = 'hidden' name = 'Q5_G_num' value = '".$questionGroup."'>";
		if($showScale == "N") {
		print"<input type = 'hidden' name = 'Q5_Scale_Top' value = '".$surQ."-".$surMaxLabel."'>";
		}
		break;
		break;		
	} 
	


	switch ($showScale)
	
	{
	case "N": 	
	print"
	<label for='slider-".$count."'>".$surQ_number.$surQ.$questionGroup."</label>
	<p><input type='range' name='Q".$count."' style='display:none' id='QID".$count."'  value='1' min='0' max='10' step='1' />				
	</p>
 	<p><span class='leftlabelalign'>".$surMinLabel."</span> <span class='rightlabelalign'>".$surMaxLabel."</span></p>
	<p>&nbsp;</p>
 	<hr>";
	break;
	
	case "Y":		
	print"
	<label for='slider-".$count."'>".$surQ_number.$surQ.$questionGroup."</label>
	<p><input type='range' name='Q".$count."' id='QID".$count."'  value='1' min='0' max='10' step='1' />				
	</p>
 	<p><span class='leftlabelalign'>".$surMinLabel."</span> <span class='rightlabelalign'>".$surMaxLabel."</span></p>
	<p>&nbsp;</p>
 	<hr>";
	break;
	}

	
	
		
	$i++;
}

//MANDATORY QUESTIONS *******************************************************************************************************
$surQ6="How likely are you to recommend this dealership to friends, family or colleagues ?";        
$surQ6T="SC";
print"<input type = 'hidden' name = 'Q6_Q_num' value = '1'>";

$surQ7="How Likely are you to return to this dealership for Service or for your next Purchase ?";        
$surQ7T="SC";
print"<input type = 'hidden' name = 'Q7_Q_num' value = '2'>";

$surQ8="How much do you feel you can trust the dealership ?";        
$surQ8T="SC";
print"<input type = 'hidden' name = 'Q8_Q_num' value = '43'>";

$surQ9="Please add any other comments you wish dealership management to see";    
$surQ9T="TX";

print"
 <label for='slider-0'>".$surQ7." </label>
 <p><input type='range' name='Q7' id='QID7' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>Definitely will NOT</span> <span class='rightlabelalign'>Definitely WILL</span></p>
 
 <p>&nbsp;</p>
 <hr>";

print"
 <label for='slider-0'>".$surQ6." </label>
 <p><input type='range' name='Q6' id='QID6' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>Definitely will not</span> <span class='rightlabelalign'>Highly Recommend</span></p>
<p>&nbsp;</p>
 <hr>";

print"
 <label for='slider-0'>".$surQ8." </label>
 <p><input type='range' name='Q8' style='display:none' id='QID8' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>NOT at all</span> <span class='rightlabelalign'>Completely</span></p>
 <p>&nbsp;</p>
 <hr>";

 print"   
 <label for='textarea-a'>".$surQ9." </label>
 <textarea name='Q9' id='QID9'/>
 </textarea>";

 if ($surEmailYN='Y') {
                
Print "
    <label for='name'>If you want us to contact you, Please enter your email address or phone number:</label>
    <input type='email' name='QEmail' id='txtemail' value=''  />
        ";
    }          
    // ####################END QUESTIONS ############################################3

   
    // **************************** Submit answers *************************************************
    Print "<p>Thank you, Please submit your answers.</p>
        <input type='submit' value='SUBMIT' />";

    //print "</fieldset>";

    Print "</form>";

end;
 
    
    
?>

Re: $_POST an Array

Posted: Sat Aug 23, 2014 5:03 pm
by Celauran
langleyv wrote:if I have a multi-dimensional array called $DataToPost[] in a form page

Code: Select all

<?php 

error_reporting();
//* used to process request */
    // allow the php to use long file info, and to allow includes
    
ini_set('allow_url_include', 1);
ini_set('allow_url_fopen', 1);
include 'dbdata2.php';


session_start();


  
    
 // Company information **********************[STEP ONE]*****************************************************************
//$company_ID = $_GET["coID"];

//$strSQL1 = "SELECT * FROM t_company WHERE co_ID = '".$company_ID."'";
//$rs = mysql_query($strSQL1);

$coName="Town+Country Volkswagen"; //$row['co_name'];
$coLogo=$row['co_logo'];
$coLogo="http://www.qr-vue.com/DEMO/logos/town+countryVW.jpg"; //.$coLogo ;
        $img = @imagecreatefrompng($coLogo);
        $myLogoH = imagesy($img);  //get the height of the image
        $ratio=$myLogoH / 25 ;
        $NewW=imagesx($img) / $ratio;
    
$surIntro=$row['co_intro_text']; 
   
$surEmailText= $row['co_contact_text'];        //text to ask for email
$surThankYou= $row['co_footer_text'];        // Thank you text

    //HEADER *********************************HEADER ****************************************************************

print"<html> 
<head>
 
    <title>".$coName."</title> 
        
    <meta name='viewport' content='width=device-width, initial-scale=1'> 
<link rel='stylesheet' href='http://demo.qr-vue.com/jquerymobile/jquery.mobile-1.1.0.min.css' />
    <script type='text/javascript' src='http://demo.qr-vue.com/jquerymobile/jquery-1.7.min.js'></script>
    <script type='text/javascript' src='http://demo.qr-vue.com/jquerymobile/jquery.mobile-1.1.0.min.js'></script>

<style type='text/css'>
.leftlabelalign {
        text-align: left;
        position: absolute;
        left: 15px;
}
.rightlabelalign {
        text-align: right;
        position: absolute;
        right: 15px;
}
</style>

</head> 

<body>

<form id='fMain' method='post' action='insert2.php' data-ajax='false' >
    <div data-role='page'data-theme='b'>";


print"
    <div data-role='header'>
        <h1><img src='".$coLogo."' width='".$newW."' height='25'</h1>
                <h3>".$coName."</h3>
    </div><!-- /header -->

    <div data-role='content'>    
        <p>".$surIntro."</p> 
    <p>".$newW."</p>";
    
        
        
        //*********************************** get GUID
    //HEADER DONE *************************************HEADER DONE ********************************************************;
$survey_ID = $_GET["suID"];
print"<input type = 'hidden' name = 'sur_ID' value = '".$survey_ID."'>";
$strSQL = "SELECT * FROM `t_Questions` WHERE qu_Survey_ID = '".$survey_ID."' ORDER BY RAND() LIMIT 5";
$rs = mysql_query($strSQL);

$i=0;

while ($row= mysql_fetch_array($rs))
{
        $count=$i+1;
        $surQ = $row['qu_text'];
        $surQ_number = trim($row['qu_Survey_Q_number']);
        $surMinLabel = $row['qu_bottom_label'];
        $surMaxLabel = $row['qu_top_label'];
        $showScale = $row['qu_scale_visible'];
        $showScale = trim($showScale);
        
        $questionGroup=$row['q_Q_Group'];
        
        
        
        
        switch ($count) {
    case 1:
        print"<input type = 'hidden' name = 'Q1txt' value = '".$surQ."'>";
                print"<input type = 'hidden' name = 'Q1_Q_num' value = '".$surQ_number."'>"; // the question number within the survey
                print"<input type = 'hidden' name = 'Q1_G_num' value = '".$questionGroup."'>"; //the Group of the question
                if($showScale == "N") {
                print"<input type = 'hidden' name = 'Q1txt' value = '".$surQ."-".$surMaxLabel."'>"; // the max label 
                }
                break;
                break; 
    case 2:
        print"<input type = 'hidden' name = 'Q2txt' value = '".$surQ."'>";
        print"<input type = 'hidden' name = 'Q2_Q_num' value = '".$surQ_number."'>";
                print"<input type = 'hidden' name = 'Q2_G_num' value = '".$questionGroup."'>";
                if($showScale == "N") {
                print"<input type = 'hidden' name = 'Q2_Scale_Top' value = '".$surQ."-".$surMaxLabel."'>";
                }
                break;
                break;
    case 3:
        print"<input type = 'hidden' name = 'Q3txt' value = '".$surQ."'>";
        print"<input type = 'hidden' name = 'Q3_Q_num' value = '".$surQ_number."'>";
                print"<input type = 'hidden' name = 'Q3_G_num' value = '".$questionGroup."'>";
                if($showScale == "N") {
                print"<input type = 'hidden' name = 'Q3_Scale_Top' value = '".$surQ."-".$surMaxLabel."'>";
                }
                break;
                break;
        case 4:
        print"<input type = 'hidden' name = 'Q4txt' value = '".$surQ."'>";
        print"<input type = 'hidden' name = 'Q4_Q_num' value = '".$surQ_number."'>";
                print"<input type = 'hidden' name = 'Q4_G_num' value = '".$questionGroup."'>";
                if($showScale == "N") {
                print"<input type = 'hidden' name = 'Q4_Scale_Top' value = '".$surQ."-".$surMaxLabel."'>";
                }
                break;
                break;
        case 5:
        print"<input type = 'hidden' name = 'Q5txt' value = '".$surQ."'>";
        print"<input type = 'hidden' name = 'Q5_Q_num' value = '".$surQ_number."'>";
                print"<input type = 'hidden' name = 'Q5_G_num' value = '".$questionGroup."'>";
                if($showScale == "N") {
                print"<input type = 'hidden' name = 'Q5_Scale_Top' value = '".$surQ."-".$surMaxLabel."'>";
                }
                break;
                break;          
        } 
        


        switch ($showScale)
        
        {
        case "N":       
        print"
        <label for='slider-".$count."'>".$surQ_number.$surQ.$questionGroup."</label>
        <p><input type='range' name='Q".$count."' style='display:none' id='QID".$count."'  value='1' min='0' max='10' step='1' />                               
        </p>
        <p><span class='leftlabelalign'>".$surMinLabel."</span> <span class='rightlabelalign'>".$surMaxLabel."</span></p>
        <p>&nbsp;</p>
        <hr>";
        break;
        
        case "Y":               
        print"
        <label for='slider-".$count."'>".$surQ_number.$surQ.$questionGroup."</label>
        <p><input type='range' name='Q".$count."' id='QID".$count."'  value='1' min='0' max='10' step='1' />                            
        </p>
        <p><span class='leftlabelalign'>".$surMinLabel."</span> <span class='rightlabelalign'>".$surMaxLabel."</span></p>
        <p>&nbsp;</p>
        <hr>";
        break;
        }

        
        
                
        $i++;
}

//MANDATORY QUESTIONS *******************************************************************************************************
$surQ6="How likely are you to recommend this dealership to friends, family or colleagues ?";        
$surQ6T="SC";
print"<input type = 'hidden' name = 'Q6_Q_num' value = '1'>";

$surQ7="How Likely are you to return to this dealership for Service or for your next Purchase ?";        
$surQ7T="SC";
print"<input type = 'hidden' name = 'Q7_Q_num' value = '2'>";

$surQ8="How much do you feel you can trust the dealership ?";        
$surQ8T="SC";
print"<input type = 'hidden' name = 'Q8_Q_num' value = '43'>";

$surQ9="Please add any other comments you wish dealership management to see";    
$surQ9T="TX";

print"
 <label for='slider-0'>".$surQ7." </label>
 <p><input type='range' name='Q7' id='QID7' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>Definitely will NOT</span> <span class='rightlabelalign'>Definitely WILL</span></p>
 
 <p>&nbsp;</p>
 <hr>";

print"
 <label for='slider-0'>".$surQ6." </label>
 <p><input type='range' name='Q6' id='QID6' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>Definitely will not</span> <span class='rightlabelalign'>Highly Recommend</span></p>
<p>&nbsp;</p>
 <hr>";

print"
 <label for='slider-0'>".$surQ8." </label>
 <p><input type='range' name='Q8' style='display:none' id='QID8' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>NOT at all</span> <span class='rightlabelalign'>Completely</span></p>
 <p>&nbsp;</p>
 <hr>";

 print"   
 <label for='textarea-a'>".$surQ9." </label>
 <textarea name='Q9' id='QID9'/>
 </textarea>";

 if ($surEmailYN='Y') {
                
Print "
    <label for='name'>If you want us to contact you, Please enter your email address or phone number:</label>
    <input type='email' name='QEmail' id='txtemail' value=''  />
        ";
    }          
    // ####################END QUESTIONS ############################################3

   
    // **************************** Submit answers *************************************************
    Print "<p>Thank you, Please submit your answers.</p>
        <input type='submit' value='SUBMIT' />";

    //print "</fieldset>";

    Print "</form>";

end;
 
    
    
?>
I see no reference to $DataToPost in there.

Re: $_POST an Array

Posted: Sat Aug 23, 2014 10:29 pm
by langleyv
OK, now I look ridiculous. I posted the base code copy instead of the one I am working on. Here it is - $DataToPost is set on line 100.

Code: Select all

<?php 

error_reporting();
//* used to process request */
    // allow the php to use long file info, and to allow includes
    
ini_set('allow_url_include', 1);
ini_set('allow_url_fopen', 1);
include 'dbdata2.php';


session_start();


  
    
 // Company information **********************[STEP ONE]*****************************************************************
//$company_ID = $_GET["coID"];

//$strSQL1 = "SELECT * FROM t_company WHERE co_ID = '".$company_ID."'";
//$rs = mysql_query($strSQL1);

$coName="Town+Country Volkswagen"; //$row['co_name'];
$coLogo=$row['co_logo'];
$coLogo="http://www.qr-vue.com/DEMO/logos/town+countryVW.jpg"; //.$coLogo ;
	$img = @imagecreatefrompng($coLogo);
  	$myLogoH = imagesy($img);  //get the height of the image
  	$ratio=$myLogoH / 25 ;
  	$NewW=imagesx($img) / $ratio;
    
$surIntro=$row['co_intro_text']; 
   
$surEmailText= $row['co_contact_text'];        //text to ask for email
$surThankYou= $row['co_footer_text'];        // Thank you text

    //HEADER *********************************HEADER ****************************************************************

print"<html> 
<head>
 
    <title>".$coName."</title> 
	
    <meta name='viewport' content='width=device-width, initial-scale=1'>
	<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' href='http://demo.qr-vue.com/jquerymobile/jquery.mobile-1.1.0.min.css' />
    <script type='text/javascript' src='http://demo.qr-vue.com/jquerymobile/jquery-1.7.min.js'></script>
    <script type='text/javascript' src='http://demo.qr-vue.com/jquerymobile/jquery.mobile-1.1.0.min.js'></script>

<style type='text/css'>
.leftlabelalign {
	text-align: left;
	position: absolute;
	left: 15px;
}
.rightlabelalign {
	text-align: right;
	position: absolute;
	right: 15px;
}
</style>

</head> 

<body>

<form id='fMain' method='post' action='inserttest.php' data-ajax='false' >
    <div data-role='page'data-theme='b'>";


print"
    <div data-role='header'>
        <h1><img src='".$coLogo."' width='".$newW."' height='25'</h1>
		<h3>".$coName."</h3>
    </div><!-- /header -->

    <div data-role='content'>    
        <p>".$surIntro."</p> 
    <p>".$newW."</p>";
    
	
	
	//*********************************** get GUID
    //HEADER DONE *************************************HEADER DONE ********************************************************;
$survey_ID = $_GET["suID"];
print"<input type = 'hidden' name = 'sur_ID' value = '".$survey_ID."'>";
$strSQL = "SELECT * FROM `t_Questions` WHERE qu_Survey_ID = '".$survey_ID."' ORDER BY RAND() LIMIT 5";
$rs = mysql_query($strSQL);

$i=0;

//Set up global entry items

$Dealer_ID=1002;
date_default_timezone_set('America/Toronto');
$Date=date('Y-m-d H:m:s');
$guid=12345;


//Now Loop through entries to get rest of array elements
$DataToPost = [];

while ($row= mysql_fetch_array($rs))
{
	$count=$i+1;
	
	$surQ = $row['qu_text'];
	$surQ_number = trim($row['qu_Survey_Q_number']);
	$surMinLabel = $row['qu_bottom_label'];
	$surMaxLabel = $row['qu_top_label'];
	$showScale = trim($row['qu_scale_visible']);
	$questionGroup=$row['q_Q_Group'];
	
$DataToPost[] = array($Dealer_ID,$survey_ID,$surQ_number,$guid,$surQ,$questionGroup,$showScale,$surMaxLabel);



	switch ($showScale)
	
	{
	case "N": 	
	print"
	<label for='slider-".$count."'>".$surQ_number.$surQ.$questionGroup."</label>
	<p><input type='range' name='Q".$count."' style='display:none' id='QID".$count."'  value='1' min='0' max='10' step='1' />				
	</p>
 	<p><span class='leftlabelalign'>".$surMinLabel."</span> <span class='rightlabelalign'>".$surMaxLabel."</span></p>
	<p>&nbsp;</p>
 	<hr>";
	break;
	
	case "Y":		
	print"
	<label for='slider-".$count."'>".$surQ_number.$surQ.$questionGroup."</label>
	<p><input type='range' name='Q".$count."' id='QID".$count."'  value='1' min='0' max='10' step='1' />				
	</p>
 	<p><span class='leftlabelalign'>".$surMinLabel."</span> <span class='rightlabelalign'>".$surMaxLabel."</span></p>
	<p>&nbsp;</p>
 	<hr>";
	break;
	}

	
	
		
	$i++;
}

print_r(array_values($DataToPost));







//MANDATORY QUESTIONS *******************************************************************************************************
$surQ6="How likely are you to recommend this dealership to friends, family or colleagues ?";        
$surQ6T="SC";
print"<input type = 'hidden' name = 'Q6_Q_num' value = '1'>";

$surQ7="How Likely are you to return to this dealership for Service or for your next Purchase ?";        
$surQ7T="SC";
print"<input type = 'hidden' name = 'Q7_Q_num' value = '2'>";

$surQ8="How much do you feel you can trust the dealership ?";        
$surQ8T="SC";
print"<input type = 'hidden' name = 'Q8_Q_num' value = '43'>";

$surQ9="Please add any other comments you wish dealership management to see";    
$surQ9T="TX";

print"
 <label for='slider-0'>".$surQ7." </label>
 <p><input type='range' name='Q7' id='QID7' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>Definitely will NOT</span> <span class='rightlabelalign'>Definitely WILL</span></p>
 
 <p>&nbsp;</p>
 <hr>";

print"
 <label for='slider-0'>".$surQ6." </label>
 <p><input type='range' name='Q6' id='QID6' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>Definitely will not</span> <span class='rightlabelalign'>Highly Recommend</span></p>
<p>&nbsp;</p>
 <hr>";

print"
 <label for='slider-0'>".$surQ8." </label>
 <p><input type='range' name='Q8' style='display:none' id='QID8' value='1' min='0' max='10' step='1' /></p>
 <p><span class='leftlabelalign'>NOT at all</span> <span class='rightlabelalign'>Completely</span></p>
 <p>&nbsp;</p>
 <hr>";

 print"   
 <label for='textarea-a'>".$surQ9." </label>
 <textarea name='Q9' id='QID9'/>
 </textarea>";

 if ($surEmailYN=='Y') {
                
Print "
    <label for='name'>If you want us to contact you, Please enter your email address or phone number:</label>
    <input type='email' name='QEmail' id='txtemail' value=''  />
        ";
    }          
    // ####################END QUESTIONS ############################################3

   
    // **************************** Submit answers *************************************************
    Print "<p>Thank you, Please submit your answers.</p>
        <input type='submit' value='SUBMIT' />";

    //print "</fieldset>";

    Print "</form>";

end;
 
    
    
?>