The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Transferring selection from dropdown box to table on next page, Can't get info from one page to populate correctly on the next pag
SeanWoods
post Mar 28 2009, 12:02 PM
Post #1


Member
***

Group: Members
Posts: 42
Joined: 23-March 09
Member No.: 8,142



On this page: http://www.grammarperfection.com/checkout.php there are 3 different drop down boxes with various options. I am having trouble getting the selected option to populate on the following page: http://www.grammarperfection.com/confirmorder.php without making the selection another drop down box.

On the second page, I do not want to have the drop down boxes again, it should only be plain text so it is not redundant.

Here is the code I am having trouble with. Note: I assume there should be code before the html starts, but whenever I put code there, I get error messages.

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"><!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="Images/gpfavicon.ico"/>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Editing, Proofreading and Grammar Checking Service - Grammar Perfection</title>
<!-- InstanceEndEditable -->
<meta name="keywords" content="service,editing,english grammar,proofreading,apa style,writing help,editorial services,essay editing,grammar help,proofread,academic paper,proofreading english,proofreading online,business editorial,proofreading service,proofreading services,business editor,write,college application,apa style,college applications,resume,editorial,resumes,edit document,writing,cover letter,cover letters,editing service,resumes cover letters,writing,apa style,apa,online editor,cbe style,cbe,proofreading essay,english,mla style,mla,editing services,chicago style, financial document,grammer help,financial documents,english writing,academic papers,copy editor,business proofreading,mla style,edit,editor,english grammer,essay help,">
<meta name="description" content="Professional proofreading and editing service. We edit essays, resumes, and other forms of writing. Let our editing specialists proofread your writing today.">
<!--GrammarPerfection.com: writing editing apa style proofreading writing editors english grammar proofreading apa style editing writing apa style editors english grammar mla style writing editing apa style editing mla style proofreading writing english grammar mla style etc.-->
<style type="text/css">
<!--
-->
</style>
<link href="CSS/layout.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
    background-image: url(Images/background.gif);
}
.style1 {
    font-size: 1px;
    color: #CCCCCC;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body>
<div id="logo"><a href="index.html"><img src="Images/grammar-perfection-proofreading-and-editing-service.jpg" alt="Grammar Perfection we catch what spell check misses" width="620" height="172" /></a></div>
<div id="navigation"><a href="index.html">Home</a> | <a href="submitdocument.html">Submit Document</a> | <a href="guarantee.html">100% Guarantee</a> | <a href="examplesofwork.html">Example of Our Work</a> | <a href="faq.html">FAQ</a> | <a href="recommendafriend.html">Get 1/2 Off Your Next Order</a> | <a href="cost.html">Cost</a></div>
<div id="wrapper">
      <div id="bodyArea">
        <div id="left">
          <h5><a href="index.html"><img src="Images/grammar-perfection-home-icon.jpg" alt="Home for proofreading and editing "class="img" longdesc="../index.html" /><br />
        Home</a></h5>
          <h5><a href="submitdocument.html"><img src="Images/submit-your-document-for-proofreading-editing-icon.jpg" alt="Submit your document for editing and proofreading" name="icons" id="icons" /><br />
        Submit Document</a></h5>
    <h5><a href="guarantee.html"><img src="Images/satisfaction-guaranteed-icon.jpg" alt="We guarantee our proofreading and editing or your money back!" name="icons" id="icons" /><br />
        100% Guarantee!</a></h5>
    <h5><a href="examplesofwork.html"><img src="Images/example-of-what-grammar-perfection-does.jpg" alt="View an example of our proofreading and editing" name="icons" id="icons" /><br />
        Example of Our Work</a></h5>
    <h5><a href="faq.html"><img src="Images/frequently-asked-questions-about-proofreading-editing.jpg" alt="Frequently asked questions about our proofreading and editing service" name="icons" id="icons" /><br />
        Frequently Asked Questions</a></h5>
    <h5><a href="recommendafriend.html"><img src="Images/proofreding-editing-discount.jpg" alt="Get half off your next proofreading and editing service" name="icons" id="icons" /><br />
        Get 1/2 Off Your Next Order!</a></h5>
    <h5><a href="cost.html"><img src="Images/cost-for-proofreading-editing-service.jpg" alt="How much does it cost for proofreading and editing" name="icons" id="icons" /><br />
        How Much Does it Cost?</a></h5>
        </div>
        <div id="right">              <!-- InstanceBeginEditable name="Main Area" -->
          <h1>Confirm Order</h1>
          <table width="620" border="0" align="center" cellpadding="2" cellspacing="2">
            <tr>
              <td class="pagetitle" align="left" nowrap="nowrap" height="20"> Confirm Order </td>
            </tr>
            <tr>
              <td class="pagetext" valign="top" width="650"><table border="1" cellpadding="4" cellspacing="0">
                  <tr>
                    <td class="pagetext"><b>Service Option</b> </td>
                    <td class="pagetext">                  
  

                    <?php
$serviceOptions = array(
   1 => "Standard - 3 Day/72 Hour Return - $5.00 Per Page",
   2 => "Expedite - 2 Day/48 Hour Return - $7.50 Per Page",
   3 => "Overnight - 1 Day/24 Hour Return - $9.00 Per Page"
   );


// note that $_POST index must exactly match name of form element:
$serviceSelection = (int) $_POST['select']; // filter input to make sure it's an integer
if(!isset($serviceOptions[$serviceSelection]))
{
   $serviceSelection = 1; // set a default value in case of invalid selection
}

// create pre-filled select element:
echo "<select name='select'>\n";
foreach($serviceOptions as $key => $value)
{
   $selected = '';
   if($key == $serviceSelection) // same as what user selected
   {
      $selected = " selected='selected'";
   }
   echo "<option value='$key'$selected>$value</option>\n";
}
echo "</select>\n";
?>

</td>
                  </tr>
                  <tr>
                    <td class="pagetext"><b>Word Count/Pages</b> </td>
                    <td class="pagetext"> </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
$serviceOptions = array(
   1 => "High School",
   2 => "College - Under Graduate",
   3 => "College - Post Graduate",
   4 => "Website",
   5 => "Business",
   6 => "Other"
   );


// note that $_POST index must exactly match name of form element:
$serviceSelection = (int) $_POST['select']; // filter input to make sure it's an integer
if(!isset($serviceOptions[$serviceSelection]))
{
   $serviceSelection = 1; // set a default value in case of invalid selection
}

// create pre-filled select element:
echo "<select name='select'>\n";
foreach($serviceOptions as $key => $value)
{
   $selected = '';
   if($key == $serviceSelection) // same as what user selected
   {
      $selected = " selected='selected'";
   }
   echo "<option value='$key'$selected>$value</option>\n";
}
echo "</select>\n";
?></td>
                  </tr>
                  <tr>
                    <td class="pagetext"><b>Writing Format</b> </td>
                    <td class="pagetext"><?php
$serviceOptions = array(
   1 => "MLA",
   2 => "AP",
   3 => "N/A"
   );


// note that $_POST index must exactly match name of form element:
$serviceSelection = (int) $_POST['select']; // filter input to make sure it's an integer
if(!isset($serviceOptions[$serviceSelection]))
{
   $serviceSelection = 1; // set a default value in case of invalid selection
}

// create pre-filled select element:
echo "<select name='select'>\n";
foreach($serviceOptions as $key => $value)
{
   $selected = '';
   if($key == $serviceSelection) // same as what user selected
   {
      $selected = " selected='selected'";
   }
   echo "<option value='$key'$selected>$value</option>\n";
}
echo "</select>\n";
?></td>
                  </tr>
                  <tr>
                    <td class="pagetext"><b>Document Status</b> </td>
                    <td class="pagetext"> <div align="left">You will be asked to e-mail your document to <a href="mailto:editor@proofmydoc.com?subject=Proof My Document: Document Attached">document@grammarperfection.com</a> AFTER submitting your payment. </div></td>
                </tr>
                </table>
                  <table border="0">
                    <tr>
                      <td align="middle" valign="top"><input type="button" id="btnEdit" value="Edit Information" onclick="history.back();" />
                      </td>
                      <td><!-- Begin PayPal Code -->
                          <!-- Order Options -->
                          <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
                            <input type="hidden" name="add" value="1" />
                            <input type="hidden" name="cmd" value="_cart" />
                            <input type="hidden" name="business" value="help@grammarperfection.com" />
                            <input type="hidden" name="item_name"  value="Standard - 3 Day/72 Hour Return - $5.00 Per Page x 2 pages" />
                            <input type="hidden" name="item_number"  value="STD" />
                            <input type="hidden" name="amount"  value="$10.00" />
                            <input type="hidden" name="currency_code" value="USD" />
                            <input type="hidden" name="bn" value="PP-ShopCartBF" />
                            <input type="hidden" name="on0" value="Level of Work" />
                            <input type="hidden" name="os0"  value="High School" />
                            <input type="hidden" name="on1" value="Writing Format" />
                            <input type="hidden" name="return" value="http://www.proofmydoc.com/send_document.html" />
                            <input type="hidden" name="os1"  value="MLA" />
                            <!-- Display Options -->
                            <!--<input type="hidden" name="cpp_header_image" value="http://www.proofmydoc.com/images/main_logo.gif"> -->
                            <input type="submit" value="Proceed to Secure Payment with PayPal" name="btnPayPal" alt="Make payments with PayPal - it's fast, free and secure!" />
                          </form>
                        <!-- End PayPal Code -->
                      </td>
                    </tr>
                </table></td>
            </tr>
          </table>
          <p> </p>
        <!-- InstanceEndEditable --></div>
        <div id="footer">
    <p><a href="customerservice.html">Customer Service</a> | <a href="links.html">Links</a> | <a href="employment.html">Employment</a></p>
  </div>
  </div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-3295634-3");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
<!-- InstanceEnd --></html>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SeanWoods
post Mar 28 2009, 04:34 PM
Post #2


Member
***

Group: Members
Posts: 42
Joined: 23-March 09
Member No.: 8,142



I found one thing I was doing wrong. I copied and pasted the code for my first option and left the word "service" in on each one ($serviceOptions, etc) rather than a new word. I changed that on my other two, but am still having trouble. On http://grammarperfection.com/checkout.php when someone chooses the service option they want, that option populates on the next page in the right spot, but the other two drop down box selections do not transfer. On http://grammarperfection.com/confirmorder.php it seems to pick an option at random from the previously selected options on the previous page (only for "level of work" and "writing format."

Lastly, the second page should no longer have drop down boxes anymore, but that seems to be the least of my worries right now.

CODE
<?php
$serviceOptions = array(
   1 => "Standard - 3 Day/72 Hour Return - $5.00 Per Page",
   2 => "Expedite - 2 Day/48 Hour Return - $7.50 Per Page",
   3 => "Overnight - 1 Day/24 Hour Return - $9.00 Per Page"
   );


// note that $_POST index must exactly match name of form element:
$serviceSelection = (int) $_POST['select']; // filter input to make sure it's an integer
if(!isset($serviceOptions[$serviceSelection]))
{
   $serviceSelection = 1; // set a default value in case of invalid selection
}

// create pre-filled select element:
echo "<select name='select'>\n";
foreach($serviceOptions as $key => $value)
{
   $selected = '';
   if($key == $serviceSelection) // same as what user selected
   {
      $selected = " selected='selected'";
   }
   echo "<option value='$key'$selected>$value</option>\n";
}
echo "</select>\n";
?>


CODE
<?php
$levelOptions = array(
   1 => "High School",
   2 => "Admission",
   3 => "College - Under Graduate",
   4 => "College - Post Graduate",
   5 => "Website",
   6 => "Business",
   7 => "Other"
   );


// note that $_POST index must exactly match name of form element:
$levelSelection = (int) $_POST['select']; // filter input to make sure it's an integer
if(!isset($levelOptions[$levelSelection]))
{
   $levelSelection = 1; // set a default value in case of invalid selection
}

// create pre-filled select element:
echo "<select name='select'>\n";
foreach($levelOptions as $key => $value)
{
   $selected = '';
   if($key == $levelSelection) // same as what user selected
   {
      $selected = " selected='selected'";
   }
   echo "<option value='$key'$selected>$value</option>\n";
}
echo "</select>\n";
?>


CODE
<?php
$formatOptions = array(
   1 => "MLA",
   2 => "AP",
   3 => "N/A"
      );


// note that $_POST index must exactly match name of form element:
$formatSelection = (int) $_POST['select']; // filter input to make sure it's an integer
if(!isset($formatOptions[$formatSelection]))
{
   $formatSelection = 1; // set a default value in case of invalid selection
}

// create pre-filled select element:
echo "<select name='select'>\n";
foreach($formatOptions as $key => $value)
{
   $selected = '';
   if($key == $formatSelection) // same as what user selected
   {
      $selected = " selected='selected'";
   }
   echo "<option value='$key'$selected>$value</option>\n";
}
echo "</select>\n";
?>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Mar 29 2009, 01:33 PM
Post #3


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



I think you are not getting any replies because you are expecting someone to debug/rewrite your program for you. Was the program written for you by someone else? If so, and if you are hoping that without understanding how the program works you can just poke it around a bit to "work", then I think you will likely fail.

CODE

// note that $_POST index must exactly match name of form element:
$levelSelection = (int) $_POST['select'];
// filter input to make sure it's an integer
if(!isset($levelOptions[$levelSelection]))
...


What is the variable $levelSelection ?
What POST argument is $levelSelection associated with, and in what way?

This might be a useful clue...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SeanWoods
post Mar 30 2009, 11:48 AM
Post #4


Member
***

Group: Members
Posts: 42
Joined: 23-March 09
Member No.: 8,142



QUOTE(Brian Chandler @ Mar 29 2009, 01:33 PM) *

I think you are not getting any replies because you are expecting someone to debug/rewrite your program for you. Was the program written for you by someone else? If so, and if you are hoping that without understanding how the program works you can just poke it around a bit to "work", then I think you will likely fail.

CODE

// note that $_POST index must exactly match name of form element:
$levelSelection = (int) $_POST['select'];
// filter input to make sure it's an integer
if(!isset($levelOptions[$levelSelection]))
...


What is the variable $levelSelection ?
What POST argument is $levelSelection associated with, and in what way?

This might be a useful clue...


Brian,

You are right. Someone started the code for me, for my first drop down box option and I tried making it work for the rest. I am trying to understand how the program works, but have been unable to find wording online which describes what is going on with this partifular code.

From what I have been reading a variable is a possible option that the user can choose, is that right?

So your question, "What is the variable $levelSelection ?" I would think it would be referring to whatever option was selected from the drop down box of possible levels,
ei: 1 => "High School",
2 => "Admission",
3 => "College - Under Graduate",
4 => "College - Post Graduate",
5 => "Website",
6 => "Business",
7 => "Other"

Your other question, "What POST argument is $levelSelection associated with, and in what way?" I am more confused on. It would make sence that the $levelSelection would put whatever selection was "posted" from the users selection on the previous page of their level (admission, college, high school, etc.). I do not have any code which tells the server to POST this selection where I need it. I would think that would be most of my problem there.

Using general terms, I believe that an argument is a variable that gets passed to the function.....This sort of gets me confused because, thinking about it (unless I am way off) a variable and an argument mean about the same thing.

I really do want to learn the what, why and how's of php, I am just in a time crunch trying to get this site live before my job tells me to take a hike since there have been lots of lay-offs (GM).

This post has been edited by SeanWoods: Mar 30 2009, 11:52 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Mar 30 2009, 12:16 PM
Post #5


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



Not trying to be unhelpful, but I do not think you can learn elementary programming, and how html forms work, and get this working "in a time crunch". Perhaps you should get someone to do it for you.

It's not easy to understand quite what the problem is: are these three chunks of code in the programs for separate pages, or what? You are accessing a _variable_ called $_POST['select'] (which is the value passed by a form on the calling page with the _name_ 'select'), and treating it as three different things in the three cases. "select" is not a sensible name, because _anything_ is "selected" in some sense or other: more sensible names would be "level", "format" and so on.

HTH
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SeanWoods
post Mar 30 2009, 01:10 PM
Post #6


Member
***

Group: Members
Posts: 42
Joined: 23-March 09
Member No.: 8,142



QUOTE(Brian Chandler @ Mar 30 2009, 12:16 PM) *

Not trying to be unhelpful, but I do not think you can learn elementary programming, and how html forms work, and get this working "in a time crunch". Perhaps you should get someone to do it for you.

It's not easy to understand quite what the problem is: are these three chunks of code in the programs for separate pages, or what? You are accessing a _variable_ called $_POST['select'] (which is the value passed by a form on the calling page with the _name_ 'select'), and treating it as three different things in the three cases. "select" is not a sensible name, because _anything_ is "selected" in some sense or other: more sensible names would be "level", "format" and so on.

HTH


You are right on the money with learning the programming. I will make more of an effort to view PHP.net to get more of any understanding of how this all works.

To answer your question, the 3 different chuncks of code refer to each of the 3 drop down boxes on the previous page http://www.grammarperfection.com/checkout....rv=2&words=

I have two different pages I am finalizing, the options page: (http://www.grammarperfection.com/checkout.php?serv=1&words), and the confirmation page: (http://www.grammarperfection.com/confirmorder.php). The confirmation page pulls the selections made from the options page. The confirmation page is where the 3 chunks of code are placed which will serve as a summary of the selections made on this previous page.

To get me started, someone had written the first chunk of code which pulled the info from the 1st drop down box on the previous page. This code did work by putting the selection from the options page onto the confirmation page, except it made it another drop down box rather than just text.

As I think more into it, the major issue with the confirmation page is that the 3 blocks of code say "here are the possible selections" but it isn't able to tell just what selection was made and is not able to show ONLY that option and not all 3.

Am I correct in saying that on the options page, every drop down option should have a variable assigned to it, and on the confirmation page, it should be able to pull the variable that was selected and POST it? Am I on the right track here?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Mar 30 2009, 10:58 PM
Post #7


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



CODE

<select name="select">


This is a batty name for an argument: _what_ does it select?

CODE

<input type="text" name="txtWordCount" size="20" maxlength="20" value="">


This is a very sensible name: txtWordCount tells us what it is. Your script handling this needs to look at the PHP variable $_POST['txtWordCount'] to get this value...

HTH
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SeanWoods
post Mar 31 2009, 10:37 PM
Post #8


Member
***

Group: Members
Posts: 42
Joined: 23-March 09
Member No.: 8,142



QUOTE(Brian Chandler @ Mar 30 2009, 10:58 PM) *

CODE

<select name="select">


This is a batty name for an argument: _what_ does it select?

CODE

<input type="text" name="txtWordCount" size="20" maxlength="20" value="">


This is a very sensible name: txtWordCount tells us what it is. Your script handling this needs to look at the PHP variable $_POST['txtWordCount'] to get this value...

HTH


OK, I have been working on this for HOURS as well as reading about php online. I got it to transfer the data from one page to another, but it kept producing another drop down box, so I started over from the beginning.

I think I have a good start although it will not populate the data into the form on the 2nd page. (problems with my POST and GET?) I know that POST puts the data in the url and GET hides it.

Page 1 where the data is coming from: http://www.grammarperfection.com/cost.html

Code above html:
CODE
<?

$serv = $_GET['serv'];
$words = $_GET['words'];

$servvalue = $serv;

if($serv == 1)
{
$serv = "Standard - 3 Day/72 Hour Return - $5.00 Per Page";
$opt1 = ' selected="timeframe"';
}


if($serv == 2)
{
$serv = "Expedite - 2 Day/48 Hour Return - $7.50 Per Page";
$opt2 = ' selected="timeframe"';
}


if($serv == 3)
{
$serv = "Overnight - 1 Day/24 Hour Return - $9.00 Per Page";
$opt3 = ' selected="timeframe"';
}

?>


Page that won't populate with the selections made from previous page: http://www.grammarperfection.com/confirmorder.php

Code:
Above HTML:
CODE

<?

$serv = $_POST['serv'];

$servvalue = $serv;

if($serv == 1)
{
$serv = "Standard - 3 Day/72 Hour Return - $5.00 Per Page";
$opt1 = ' selected="timeframe"';
}

if($serv == 2)
{
$serv = "Expedite - 2 Day/48 Hour Return - $7.50 Per Page";
$opt2 = ' selected="timeframe"';
}

if($serv == 3)
{
$serv = "Overnight - 1 Day/24 Hour Return - $9.00 Per Page";
$opt3 = ' selected="timeframe"';
}

// New code below which refers to my 2nd drop down box - Level of Work

$level = $_POST['lev'];

if($lev == 4)
{
$lev = "High School";
$opt4 = ' selected="level"';
}

if($lev == 5)
{
$lev = "College - Admission";
$opt5 = ' selected="level"';
}

if($lev == 6)
{
$lev = "College - Under Graduate";
$opt6 = ' selected="level"';
}

if($lev == 7)
{
$lev = "College - Post Graduate";
$opt7 = ' selected="level"';
}

if($lev == 8)
{
$lev = "Website";
$opt8 = ' selected="level"';
}

if($lev == 9)
{
$lev = "Business";
$opt9 = ' selected="level"';
}

if($lev == 10)
{
$lev = "Other";
$opt10 = ' selected="level"';
}

?>



Code where I want the Service Option:
CODE
<?
if($serv == 1){

$serv = 'Standard - 3 Day/72 Hour Return - $5.00 Per Page';

}

if($serv == 2){

$serv = 'Expedite - 2 Day/48 Hour Return - $7.50 Per Page';

}

if($serv == 3){

$serv = 'Overnight - 1 Day/24 Hour Return - $9.00 Per Page';

}

?>


Code where I want the Level of Work shown:
CODE
<?
if($lev == 4){

$lev = 'High School';

}

if($lev == 5){

$lev = 'College - Admission';

}

if($lev == 6){

$lev = 'College - Under Graduate';

}

if($lev == 7){

$lev = 'College - Post Graduate';

}

if($lev == 8){

$lev = 'Website';

}if($lev == 9){

$lev = 'Business';

}

if($lev == 10){

$lev = 'Other';

}

?>


This post has been edited by SeanWoods: Mar 31 2009, 10:43 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Apr 1 2009, 10:50 AM
Post #9


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE
I know that POST puts the data in the url and GET hides it.
Sorry, it's the other way around. GET puts the data in the URL and POST doesn't. But see also Methods GET and POST in HTML forms - what's the difference?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SeanWoods
post Apr 2 2009, 07:03 PM
Post #10


Member
***

Group: Members
Posts: 42
Joined: 23-March 09
Member No.: 8,142



QUOTE(Darin McGrew @ Apr 1 2009, 10:50 AM) *

QUOTE
I know that POST puts the data in the url and GET hides it.
Sorry, it's the other way around. GET puts the data in the URL and POST doesn't. But see also Methods GET and POST in HTML forms - what's the difference?


GOT IT WORKING! (Except on Internet Explorer?)

I finally have it where it will post the choice made in the drop down boxes from this page: http://www.grammarperfection.com/checkout.php? to this page: http://grammarperfection.com/confirmorder.php but for some reason the "proceed with order" button won't work on Internet Explorer. (The button is on the bottom of http://www.grammarperfection.com/checkout.php?)

It works fine on Firefox and Google Chrome. I have not tried any other browsers.

Here is the code for the button:
CODE
<td class="pagetext" colspan="2"><input type="submit" value="Proceed With Order" name="btnOrder" />


Code on first page:
CODE
//For 1st drop down box (populated from data on previous page)
<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>                    
       <form method=post action=''>

//For 2nd drop down box
<form method=post action=''>
<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><form method=post action=''>
</form>

//For 3rd drop down box
<select name='format[]'>
<option value='MLA'>MLA</option>
<option value='AP'>AP</option>
<option value='N/A'>N/A</option>
</select><form method=post action=''>
</form>

<td class="pagetext" colspan="2"><input type="submit" value="Proceed With Order" name="btnOrder" />


Code for 2nd page:
CODE
//Data from 1st drop down box
<?
                   @$format= $_POST['serviceOption'];
if( is_array($serviceOption)){
while (list ($key, $val) = each ($serviceOption)) {
echo "$val <br>";
}
}//else{echo "not array";}  
?>

//Data from 2nd drop down box
<?
                   @$format= $_POST['level'];
if( is_array($level)){
while (list ($key, $val) = each ($level)) {
echo "$val <br>";
}
}//else{echo "not array";}  
?>

//Data from 3rd drop down box
<?
                   @$format= $_POST['format'];
if( is_array($format)){
while (list ($key, $val) = each ($format)) {
echo "$val <br>";
}
}//else{echo "not array";}  
?>


This post has been edited by SeanWoods: Apr 2 2009, 07:06 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SeanWoods
post Apr 3 2009, 06:21 AM
Post #11


Member
***

Group: Members
Posts: 42
Joined: 23-March 09
Member No.: 8,142



QUOTE(SeanWoods @ Apr 2 2009, 07:03 PM) *

QUOTE(Darin McGrew @ Apr 1 2009, 10:50 AM) *

QUOTE
I know that POST puts the data in the url and GET hides it.
Sorry, it's the other way around. GET puts the data in the URL and POST doesn't. But see also Methods GET and POST in HTML forms - what's the difference?


GOT IT WORKING! (Except on Internet Explorer?)

I finally have it where it will post the choice made in the drop down boxes from this page: http://www.grammarperfection.com/checkout.php? to this page: http://grammarperfection.com/confirmorder.php but for some reason the "proceed with order" button won't work on Internet Explorer. (The button is on the bottom of http://www.grammarperfection.com/checkout.php?)

It works fine on Firefox and Google Chrome. I have not tried any other browsers.

Here is the code for the button:
CODE
<td class="pagetext" colspan="2"><input type="submit" value="Proceed With Order" name="btnOrder" />


Code on first page:
CODE
//For 1st drop down box (populated from data on previous page)
<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>                    
       <form method=post action=''>

//For 2nd drop down box
<form method=post action=''>
<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><form method=post action=''>
</form>

//For 3rd drop down box
<select name='format[]'>
<option value='MLA'>MLA</option>
<option value='AP'>AP</option>
<option value='N/A'>N/A</option>
</select><form method=post action=''>
</form>

<td class="pagetext" colspan="2"><input type="submit" value="Proceed With Order" name="btnOrder" />


Code for 2nd page:
CODE
//Data from 1st drop down box
<?
                   @$format= $_POST['serviceOption'];
if( is_array($serviceOption)){
while (list ($key, $val) = each ($serviceOption)) {
echo "$val <br>";
}
}//else{echo "not array";}  
?>

//Data from 2nd drop down box
<?
                   @$format= $_POST['level'];
if( is_array($level)){
while (list ($key, $val) = each ($level)) {
echo "$val <br>";
}
}//else{echo "not array";}  
?>

//Data from 3rd drop down box
<?
                   @$format= $_POST['format'];
if( is_array($format)){
while (list ($key, $val) = each ($format)) {
echo "$val <br>";
}
}//else{echo "not array";}  
?>




Now I have it working on IE. I had too many opening form tags.

How can I mark this post as "solved?"

Thanks for the help everyone smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 03:54 AM