www.webdeveloper.com
Results 1 to 3 of 3

Thread: NOT WORKING WHY?<form action="checkoutcart.php" method="post">

Hybrid View

  1. #1
    Join Date
    Mar 2012
    Posts
    8

    NOT WORKING WHY?<form action="checkoutcart.php" method="post">

    Hello All,

    I have a series of dymanic select lists similar to a drop down menu and i want the selected option from the page to be written(posted) to checkoutcart.php

    I have the following error appear
    Code:
    APPS1 
    Notice: Undefined index: APPS1 in D:\shares\web\soft20171\N0322099\coursework assignment 2\checkoutcart.php on line 35
    
    
    APPS2 
    Notice: Undefined index: APPS2 in D:\shares\web\soft20171\N0322099\coursework assignment 2\checkoutcart.php on line 36
    
    
    APPS3 
    Notice: Undefined index: APPS3 in D:\shares\web\soft20171\N0322099\coursework assignment 2\checkoutcart.php on line 37
    
    
    APPS4 
    Notice: Undefined index: APPS4 in D:\shares\web\soft20171\N0322099\coursework assignment 2\checkoutcart.php on line 38
    
    
    APPS5 
    Notice: Undefined index: APPS5 in D:\shares\web\soft20171\N0322099\coursework assignment 2\checkoutcart.php on line 39
    
    
    APPS6 
    Notice: Undefined index: APPS6 in D:\shares\web\soft20171\N0322099\coursework assignment 2\checkoutcart.php on line 40

    APP LIST PAGE
    Code:
    <form action="checkoutcart.php" method="post">
              <label for="APPS1">SELECT</label>
              <select input name="APPS1" id="APPS1">
                <?php
    do {  
    ?>
                <option value="<?php echo $row_DROPDOWNPRODUCTS['NAME']?>"><?php echo $row_DROPDOWNPRODUCTS['NAME']?></option>
                <?php
    } while ($row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS));
      $rows = mysql_num_rows($DROPDOWNPRODUCTS);
      if($rows > 0) {
          mysql_data_seek($DROPDOWNPRODUCTS, 0);
    	  $row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS);
      }
    ?>
              </select>
              
              <BR>
               <label for="APPS2">SELECT</label>
              <select name="APPS2" id="APPS2">
                <?php
    do {  
    ?>
                <option value="<?php echo $row_DROPDOWNPRODUCTS['NAME']?>"><?php echo $row_DROPDOWNPRODUCTS['NAME']?></option>
                <?php
    } while ($row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS));
      $rows = mysql_num_rows($DROPDOWNPRODUCTS);
      if($rows > 0) {
          mysql_data_seek($DROPDOWNPRODUCTS, 0);
    	  $row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS);
      }
    ?>
              </select>
              <BR>
              <label for="APPS3">SELECT</label>
              <select name="APPS3" id="APPS3">
                <?php
    do {  
    ?>
                <option value="<?php echo $row_DROPDOWNPRODUCTS['NAME']?>"><?php echo $row_DROPDOWNPRODUCTS['NAME']?></option>
                <?php
    } while ($row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS));
      $rows = mysql_num_rows($DROPDOWNPRODUCTS);
      if($rows > 0) {
          mysql_data_seek($DROPDOWNPRODUCTS, 0);
    	  $row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS);
      }
    ?>
              </select>
              <BR>
              <label for="APPS4">SELECT</label>
              <select name="APPS4" id="APPS4">
                <?php
    do {  
    ?>
                <option value="<?php echo $row_DROPDOWNPRODUCTS['NAME']?>"><?php echo $row_DROPDOWNPRODUCTS['NAME']?></option>
                <?php
    } while ($row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS));
      $rows = mysql_num_rows($DROPDOWNPRODUCTS);
      if($rows > 0) {
          mysql_data_seek($DROPDOWNPRODUCTS, 0);
    	  $row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS);
      }
    ?>
              </select>
              <BR>
              <label for="APPS5">SELECT</label>
              <select name="APPS5" id="APPS5">
                <?php
    do {  
    ?>
                <option value="<?php echo $row_DROPDOWNPRODUCTS['NAME']?>"><?php echo $row_DROPDOWNPRODUCTS['NAME']?></option>
                <?php
    } while ($row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS));
      $rows = mysql_num_rows($DROPDOWNPRODUCTS);
      if($rows > 0) {
          mysql_data_seek($DROPDOWNPRODUCTS, 0);
    	  $row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS);
      }
    ?>
              </select>
              <BR>
              <label for="APPS6">SELECT</label>
              <select name="APPS6" id="APPS6">
                <?php
    do {  
    ?>
                <option value="<?php echo $row_DROPDOWNPRODUCTS['NAME']?>"><?php echo $row_DROPDOWNPRODUCTS['NAME']?></option>
                <?php
    } while ($row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS));
      $rows = mysql_num_rows($DROPDOWNPRODUCTS);
      if($rows > 0) {
          mysql_data_seek($DROPDOWNPRODUCTS, 0);
    	  $row_DROPDOWNPRODUCTS = mysql_fetch_assoc($DROPDOWNPRODUCTS);
      }
    ?>
              </select>
              <input type="submit" /> </p>
    
            </form>
    CHECKOUTCART.PHP PAGE

    Code:
    <p>APPS1	<?php echo $_GET["APPS1"]; ?></p>
    <p>APPS2	<?php echo $_GET["APPS2"]; ?></p>
    <p>APPS3	<?php echo $_GET["APPS3"]; ?></p>
    <p>APPS4	<?php echo $_GET["APPS4"]; ?></p>
    <p>APPS5	<?php echo $_GET["APPS5"]; ?></p>
    <p>APPS6	<?php echo $_GET["APPS6"]; ?></p>

  2. #2
    Join Date
    Oct 2012
    Posts
    42
    You are submitting the form via the POST method, but trying to read the form values via GET.
    Change the reference $_GET in checkoutcart.php to $_POST .i.e $_GET["APPS1"] should be $_POST["APPS1"] and so on.

  3. #3
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    428

    _GET instead of _POST

    You're output script uses $_GET instead of $_POST variables. form method is post.


    Swon

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles