Results 1 to 5 of 5
  1. #1
    Join Date
    May 2008
    Location
    New Zealand
    Posts
    32
    Plugin Contributions
    0

    Default Form action posting back to tpl_checkout_success

    I

    I am trying to customise my tpl_checkout_success_default.php to perform an action if a specific product has been purchased.

    So far I have:
    PHP Code:
    <?php

    $sql 
    "SELECT products_id, products_quantity from orders_products where orders_id = " $zv_orders_id;
    $result $db->Execute($sql);
    while(!
    $result->EOF) {
      if (
    $result->fields['products_id'] == 192) {
        
    $no_purchased $result->fields['products_quantity'];
      }
      
    $result->MoveNext();
    }

    if (!isset(
    $_POST['submit']))
        {
        
    $row_current 1;
        echo 
    "<p><strong>Here is my Form</strong></p>";
        echo 
    "<form method=\"post\" action=\"" .$_SERVER['PHP_SELF']. "\">";
        while (
    $row_current <= $no_purchased)
        {
        echo 
    "<table>";
        echo 
    "<tr>";
        echo 
    "<td>Serial number " .$row_current.":  </td>";
        echo 
    "<td><input type='text' name='serial".$row_current."'></td>";
        echo 
    "</tr>";
        echo 
    "</table>";
        
    $row_current++;
    }
    echo 
    "<br/>";
    echo 
    "<input type='image' src='includes/templates/sd/buttons/english/button_confirm_send.gif' name='submit'>";
    echo 
    "</form>";
    echo 
    "<br/><br/>";
    }
    else {
        echo 
    "the answer is '$serial1'";
    }
    ?>
    The form displays fine, but when I enter some data into the form and clcik 'submit', it returns to my product page. I think the problem is with the:

    echo "<form method=\"post\" action=\"" .$_SERVER['PHP_SELF']. "\">";

    line.

    Can anyone help?

    Thanks

    G

  2. #2
    Join Date
    May 2008
    Location
    New Zealand
    Posts
    32
    Plugin Contributions
    0

    Default Re: Form action posting back to tpl_checkout_success

    Is there anybody out there.......

    Can anybody help me with this?

    Thanks

    Glenn

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Form action posting back to tpl_checkout_success

    I don't know enough about forms to know whether $_SERVER['PHP_SELF'] is the right thing to use in that spot, but you can at least make the code a bit cleaner by using nested single and double quotes instead of \".
    PHP Code:
        echo '<form method="post" action="' .$_SERVER['PHP_SELF']. '">'

  4. #4
    Join Date
    May 2008
    Location
    New Zealand
    Posts
    32
    Plugin Contributions
    0

    Default Re: Form action posting back to tpl_checkout_success

    Thanks gjh42, I'll clean that up.

    My core problem still exists though, can anyone help please?!?!?!?!

    Thanks

    G

  5. #5
    Join Date
    May 2008
    Location
    New Zealand
    Posts
    32
    Plugin Contributions
    0

    Default Re: Form action posting back to tpl_checkout_success

    I have a solution to all of my questions re this, and have developed a working software license code generator.

    At the moment it is just amendments to some of the pages, I've not developed it as a module.

    It is for a very specific purpose, so may not be useful to anyone else, but if you're interested drop me a line.

    Glenn

 

 

Similar Threads

  1. v154 Posting Newsletters in PDF form
    By Dr Huh in forum General Questions
    Replies: 2
    Last Post: 5 Jun 2015, 09:50 PM
  2. Google Check Out not posting order back to store
    By JS1scuba in forum Addon Payment Modules
    Replies: 9
    Last Post: 14 Mar 2011, 05:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR