I am able to get my "word count" and "page count" to populate in the form on this page: http://www.grammarperfection.com/checkout.php, but when I try to send it to the next form on my confirmation page: http://www.grammarperfection.com/confirmorder.php, it will not populate. On this page, I would also prefer it not to be in text boxes, but in plain text similar to the other items above and below.
Any ideas on what I am doing wrong?
(I left out unrelated parts of code to make it fit on this post)
First Page:
<?
$serv = $_GET['serv']; // retrieves the data and creates a variable called $serv
$words = $_GET['words']; // as above
$servvalue = $serv; // creating a value to go in the drop down box..
if($serv == 1)
{
$serv = "Standard - 3 Day/72 Hour Return - $5.00 Per Page";
$opt1 = ' selected="selected"';
}
if($serv == 2)
{
$serv = "Expedite - 2 Day/48 Hour Return - $7.50 Per Page";
$opt2 = ' selected="selected"';
}
if($serv == 3)
{
$serv = "Overnight - 1 Day/24 Hour Return - $9.00 Per Page";
$opt3 = ' selected="selected"';
}
?>
<!-- html markup added here -->
<form method=post action=''>
<select name='serviceOption[]'>
<option value="Standard - 3 Day/72 Hour Return - $5.00 Per Page"<?php echo $opt1?>>Standard - 3 Day/72 Hour Return - $5.00 Per Page</option>
<option value="Expedite - 2 Day/48 Hour Return - $7.50 Per Page"<?php echo $opt2?>>Expedite - 2 Day/48 Hour Return - $7.50 Per Page</option>
<option value="Overnight - 1 Day/24 Hour Return - $9.00 Per Page"<?php echo $opt3?>>Overnight - 1 Day/24 Hour Return - $9.00 Per Page</option>
</select>
<!-- finish --> </td>
</tr>
<tr>
<td class="pagetext" width="132"><b>Word Count/Pages</b><br />
(300 Words=1 Page) </td>
<td class="pagetext">
<!-- Word Count Below -->
<form method=post action=''>
<input type="text" name="txtWordCount" size="12" maxlength="12" value="
<?php echo $words; ?>" /></a>Words</a>
<input type="text" name="txtWordCount" size="4" maxlength="4"
value="<?php echo ceil($words/300); ?>" /></a>Pages</a>
<br />
<a href="/cost.html">Word Counter/Cost Estimator</a> </td>
</tr>
<tr>
<td class="pagetext"><b>Level of Work</b> </td>
<td>
<select name='level[]'>
<option value='High School'>High School</option>
<option value='College - Admission'>College - Admission</option>
<option value='College - Under Graduate'>College - Under Graduate</option>
<option value='College - Post Graduate'>College - Post Graduate</option>
<option value='Website'>Website</option>
</select> </td>
</tr>
<tr>
<td class="pagetext"><b>Writing Format</b> </td>
<td><select name='format[]'>
<option value='MLA'>MLA</option>
<option value='AP'>AP</option>
<option value='N/A'>N/A</option>
</select> </td>
</tr>
<tr>
<td class="pagetext"><input type="submit" value="Proceed With Order" name="btnOrder" /></td>
<td> </td>
</tr>
<p><a href="customerservice.html">Customer Service</a> | <a href="links.html">Links</a> | <a href="employment.html">Employment</a></p>
</div>
</div>
</div>
Second Page:
<?php
$words = $_GET['words'];
?>
<!-- InstanceBeginEditable name="Main Area" -->
<script language="JavaScript">
function countit(){
var formcontent=document.wordcount.wordcount2.value
formcontent=formcontent.split(" ")
document.wordcount.wordcount3.value=formcontent.length
document.quickcalculator.txtWordCount.value = formcontent.length;
}
function quickcalc(){
var numWords = document.quickcalculator.txtWordCount.value;
var costEstimate;
var numPages = Math.ceil(numWords/300);
// Standard Cost Estimate
costEstimate = numPages*5.00;
document.estimates.txtStandardEst.value = "$" + costEstimate.toFixed(2);
// Expedite Cost Estimate
costEstimate = numPages*7.50;
document.estimates.txtExpediteEst.value = "$" + costEstimate.toFixed(2);
// Overnight Cost Estimate
costEstimate = numPages*9.00;
document.estimates.txtOvernightEst.value = "$" + costEstimate.toFixed(2);
// Display the estimate table.
document.getElementById("tblEstimates").style.display = "block";
}
function goToCheckout(serviceOption){
var numWords = document.quickcalculator.txtWordCount.value;
var checkoutUrl = "/checkout.php?";
window.location.href = checkoutUrl + "serv=" + serviceOption + "&words=" + numWords;
}
</script>
<script type ="text/javascript" src="/scripts/header.js"></script>
<h1>Confirm Order</h1>
<table width="630" border="0" align="left" cellpadding="2" cellspacing="2">
<tr>
<td class="pagetitle" align="left" nowrap="nowrap" height="20"> </td>
</tr>
<tr>
<td class="pagetext" valign="top" width="625"><table border="1" cellpadding="4" cellspacing="0">
<tr>
<td width="130" class="pagetext"><b>Service Option</b> </td>
<td width="479" class="pagetext">
<?php @$format= $_POST['serviceOption'];
if( is_array($serviceOption)){
while (list ($key, $val) = each ($serviceOption)) {
echo "$val <br>";
}
}//else{echo "not array";}
?></td>
</tr>
<tr>
<td class="pagetext"><b>Word Count/Pages</b> </td>
<td class="pagetext">
<!-- Word Count Below -->
<form method=post action=''>
<input type="text" name="txtWordCount" size="12" maxlength="12" value="
<?php echo $words; ?>" /></a>Words</a>
<input type="text" name="txtWordCount" size="4" maxlength="4"
value="<?php echo ceil($words/300); ?>" /></a>Pages</a> </td>
</tr>
<tr>
<td class="pagetext"><b>Cost</b> </td>
<td class="pagetext"> </td>
</tr>
<tr>
<td class="pagetext"><b>Level Of Work</b> </td>
<td class="pagetext">
<?php @$format= $_POST['level'];
if( is_array($level)){
while (list ($key, $val) = each ($level)) {
echo "$val <br>";
}
}//else{echo "not array";}
?>
</td>
</tr>
<tr>
<td class="pagetext"><b>Writing Format</b> </td>
<td class="pagetext">
<?php @$format= $_POST['format'];
if( is_array($format)){
while (list ($key, $val) = each ($format)) {
echo "$val <br>";
}
}//else{echo "not array";}
?></td>
</tr>