Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Problem redirecting upon form submission

    I'd recommend putting them in the template (tpl) file and having the form callback to the same page. If form validation is successful, redirect to the next page.

    Equally valid is to have the form go to the next page, and have that page's header_php.php validate the form and if it fails redirect back.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  2. #12
    Join Date
    May 2008
    Posts
    31
    Plugin Contributions
    0

    Default Re: Problem redirecting upon form submission

    Allright! Thanks for the reply. First, I'm going to try a form with a callback to itself, validate, then redirect.

    To make sure I understand, when you say to put "them" in the tpl file, are you referring to putting both the form tags AND the validation code in the tpl file? I thought that DrBytes mentioned that any redirect has to occur from within the header_php file. If this is the case, maybe I need to try your second suggestion of form action to second page, validate, then redirect back if there are errors.


    Thanks again for all your help!

    Dustin

  3. #13
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Problem redirecting upon form submission

    Following the example from the thread I posted a link to:

    - header_php.php does the validation and processing (ie: all "logic")
    - tpl file contains form tags and all visual/input interface components (ie: all "display" and info-collection)
    - language file (named similar to the page name) stores language-specific text that the template uses for output purposes (not editable from the admin)
    - define_xxxx.php file could optionally be used to display some informational content, but is not required at all (ie: display-only info that you want to be able to frequently alter from the admin). DefinePages are only intended as a convenience for frequent-edit needs.

    The following might be overkill, but could be a handy reference: http://www.zen-cart.com/index.php?ma...roducts_id=378
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #14
    Join Date
    May 2008
    Posts
    31
    Plugin Contributions
    0

    Default Re: Problem redirecting upon form submission

    Per DrBytes last post, I'll try dividing up my current non-functional form (which presently also contains the validation code) and will put the validation (w/redirect) in the header_php, and the form with callback in the tpl file.

    Anything else I should take into consideration?

    I'm excited to give this a try! Thanks!

    Dustin

  5. #15
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Problem redirecting upon form submission

    The band-signup attachment in my first link shows the file structure of a page intended to collect signup details, validate the data, and then send it via email to the store owner. Storing into database tables instead of emailing follows the same concept.
    Nothing wrong with looking through it for examples and using it as a model.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #16
    Join Date
    May 2008
    Posts
    31
    Plugin Contributions
    0

    Default Re: Problem redirecting upon form submission

    Whew! I think I've got the functionality working now. I'm in the process of using DrBytes's band_signup attachment to use as a starting point to get things going.

    Thanks so much to DrBytes and kuroi for for getting me headed in the right direction.

    Regards,

    Dustin

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v153 Add custom form submission data access on Admin backend
    By fahadali in forum Customization from the Admin
    Replies: 9
    Last Post: 12 Feb 2016, 02:59 AM
  2. Odd extra elements in URL after form submission
    By gjh42 in forum Contribution-Writing Guidelines
    Replies: 5
    Last Post: 28 Aug 2014, 04:40 PM
  3. Retaining data in form submission
    By ethangreen in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Jun 2009, 08:53 PM
  4. Simple Submission Form in EZ-Pages
    By pensive612 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 18 Apr 2007, 10:46 PM
  5. required file on a submission form
    By iano in forum General Questions
    Replies: 1
    Last Post: 14 Oct 2006, 05:16 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