Results 1 to 5 of 5
  1. #1
    Join Date
    May 2008
    Location
    United States
    Posts
    491
    Plugin Contributions
    1

    help question Page validating (error checking)

    I modified a page that currently is validating a form entry making sure it is filled in before submitting, works fine HOWEVER I change the action from the following:

    PHP Code:
    <?php echo zen_draw_form('pagename'zen_href_link(FILENAME_PAGENAME'action=send''SSL')); ?>
    to:

    PHP Code:
    <form method="POST" action="/test-page.php" target="popup"
    which kills the validation and lets the user submit the form with or without filling in the entry.


    I narrowed the code that controls this down to the following in the pages header file:

    PHP Code:
      $error false;
      if (isset(
    $_GET['action']) && ($_GET['action'] == 'send')) {
        
    $fieldname1 zen_db_prepare_input($_POST['fieldname1']); 
    Anyone know how to to rewrite the code to make it work again?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Page validating (error checking)

    Quote Originally Posted by marcopolo View Post
    I modified a page that currently is validating a form entry making sure it is filled in before submitting, works fine HOWEVER I change the action from the following:

    PHP Code:
    <?php echo zen_draw_form('pagename'zen_href_link(FILENAME_PAGENAME'action=send''SSL')); ?>
    to:

    PHP Code:
    <form method="POST" action="/test-page.php" target="popup"
    which kills the validation and lets the user submit the form with or without filling in the entry.


    I narrowed the code that controls this down to the following in the pages header file:

    PHP Code:
      $error false;
      if (isset(
    $_GET['action']) && ($_GET['action'] == 'send')) {
        
    $fieldname1 zen_db_prepare_input($_POST['fieldname1']); 
    Anyone know how to to rewrite the code to make it work again?
    Ummm... Change it back?

    Otherwise, append the ?action=send parameter to your form's action?

    such as:
    PHP Code:
    <form method="POST" action="/test-page.php?action=send" target="popup"
    Though hopefully you have also echoed the result of: zen_hide_session_id() within the open form and close form since the form's post is not being generated with the zen_draw_form function...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    May 2008
    Location
    United States
    Posts
    491
    Plugin Contributions
    1

    Default Re: Page validating (error checking)

    Changing it back does not work because on submitting the form it just goes to another zen cart page whereas what I changed it to goes to external page, which I need it to do.

    Good idea:

    PHP Code:
    <form method="POST" action="/test-page.php?action=send" target="popup"
    tried it, does not work.

  4. #4
    Join Date
    May 2008
    Location
    United States
    Posts
    491
    Plugin Contributions
    1

    Default Re: Page validating (error checking)

    Nevermind studying the way the original worked I was able to make it work.

  5. #5
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Page validating (error checking)

    Quote Originally Posted by marcopolo View Post
    Changing it back does not work because on submitting the form it just goes to another zen cart page whereas what I changed it to goes to external page, which I need it to do.

    Good idea:

    PHP Code:
    <form method="POST" action="/test-page.php?action=send" target="popup"
    tried it, does not work.
    Ahh, okay think I understand the situation a little better, though I think I've commented on how this ought to go previously. So, you want the action page identified in the posted form to either validate the data from the posted form or to receive posted data that has already been validated...

    So again, either the post form action posts to itself where if the data passes the validation then the popup window is presented with the posted data, or if the action page is as provided above, then it should provide validation up front before possibly using a similar action=send check as the indcator to perform the validation and if it fails to return to the original page with all of the orignal post data intact. If the page is "external" then there are some other things that may need to be considered with regards to using zc functions... In a way the applicable additional images popup screen may provide some assistance on code examples, though I'm not sure there is much in the way of validation there other than that the image is on the server...

    Well, shucks wish I had waited a moment for that other response before typing the above... Ahh well... :)
    Last edited by mc12345678; 19 Oct 2015 at 10:07 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Validating Product Info Page
    By moesoap in forum General Questions
    Replies: 14
    Last Post: 28 Jun 2011, 02:17 PM
  2. Error in validating dates in advanced search
    By tlahtine in forum Bug Reports
    Replies: 0
    Last Post: 4 Oct 2010, 12:01 PM
  3. Please Help (fsockopen Error when checking out on shipping page) - GoDaddy
    By DTB in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 5 Jul 2007, 01:07 AM
  4. Validating product_info page
    By Sake in forum General Questions
    Replies: 1
    Last Post: 23 May 2007, 08:05 PM

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