Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Creating a New page

    Hi,

    I want to create a new form for my site.

    The code is in two parts, the first is the submit page and the second is the form action etc.

    What can I add to these pages so that they are part of the zen site? i.e the header footer etc,,???

    at the moment the page is soley the form.

    Please help

    Phil

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Creating a New page

    What information is this "form" going to capture?
    Where is the information to be stored?
    How is the information going to be used in your webshop?

    If the data it captures is going to be used (either administratively or communicatively) as part of your store, then you will need to write/edit the php files so that the data is HANDLED properly.

    If you just want a form to capture info, and don't need to use that data as an inherent component in the webshop, you could consider a nifty little tool like Appnitro's MachForm.

    I use it HERE.

    This captures data to a SEPARATE database, but in this case, it suits my client's needs.
    20 years a Zencart User

  3. #3
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Creating a New page

    Quote Originally Posted by schoolboy View Post
    What information is this "form" going to capture?
    Where is the information to be stored?
    How is the information going to be used in your webshop?

    If the data it captures is going to be used (either administratively or communicatively) as part of your store, then you will need to write/edit the php files so that the data is HANDLED properly.

    If you just want a form to capture info, and don't need to use that data as an inherent component in the webshop, you could consider a nifty little tool like Appnitro's MachForm.

    I use it HERE.

    This captures data to a SEPARATE database, but in this case, it suits my client's needs.

    I litterally Just want the form to submit the info to my email nothing else. I have the files working but dont know how to implement them as part of the site.

    I have the following:

    competition_entry.php:-

    PHP Code:
    <form action="competition_submit.php" method="post">

    <
    h2 align="left">Competition January Draw</h2>

    <
    p>Enter Your details below to enter this months draw! </p>

    <
    br />

    Name: <input type="text" name="nameis" size="20" /> Email: <input type="text" name="visitormail" size="20" />

    <
    br/> 

    </
    p>

    <
    p align="left">
    Quesiton Name the characters from The Wizard of Oz?

    <
    br />
    <
    h3 align="left">Answer</h3>
    <
    p align="left">
    <
    textarea name="feedback" rows="6" cols="30">Type your answer here..</textarea>
    </
    p>

    <
    hr />
    <
    p align="left">
    <
    input type="submit" value="Enter Draw" />
    </
    p>

    </
    form
    competition_submit.php:-

    PHP Code:
    <h3 align="center">Your entry has been submitted, Good Luck!</h3>
    <!-- VIP: change YourEmail to your real email -->

    <?php

    $ip 
    $_POST['ip'];
    $httpagent $_POST['httpagent'];
    $httpref $_POST['$httpref'];
    $nameis $_POST['nameis'];
    $visitormail $_POST['visitormail'];
    $feedback $_POST['feedback'];
    $rating $_POST['rating'];
    $emailvalidation $_POST['emailvalidation'];
    $fieldvalidation $_POST['fieldvalidation'];
    $htmlcontrol$_POST['htmlcontrol'];
    $phpform $_POST['phpform'];
    $htmlform $_POST['htmlform'];
    $attn $_POST['attn'];

    if (
    eregi('http:'$feedback)) { die ("Do NOT try that! ! "); }

    if((!
    $visitormail == "") && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
    {
    echo 
    "<h2>Use Back - Enter valid e-mail</h2>\n";
    $tellem "<h2>Entry was NOT submitted</h2>\n";
    }

    if(empty(
    $nameis) || empty($feedback) || empty($visitormail)) {
    echo 
    "<h2>Use Back - fill in all fields</h2>\n";
    }

    echo 
    $tellem;

    if (
    $emailvalidation == "y") {
    $req1 "Email format Validation \n" ;
    }

    if (
    $fieldvalidation == "y") {
    $req2 "Required Form Field Validation \n";
    }
    if (
    $htmlcontrol == "y") {
    $req3 "More intergratd HTML (in form) \n";
    }
    if (
    $phpform == "y") {
    $req4 "Improved PHP form script generator \n";
    }
    if (
    $htmlform == "y") {
    $req5 "A complete HTML form generator \n";
    }
    $req $req1 $req2 $req3 $req4 $req5;

    $todayis date("l, F j, Y, g:i a") ;

    $month date("F");

    $attn $attn;
    $subject $attn;

    $feedback stripcslashes($feedback);

    $message $todayis \n
    Your Email: 
    $nameis ($visitormail)\n
    Your Answer: 
    $feedback \n
    "
    ;

    $from "From: $visitormail\r\n";

    mail("[email protected]""COMPETITION ENTRY - ".$month$message$from);


    $screenout str_replace("\n""<br/>"$message);
    ?>


    <p align="center">

    <?php echo $screenout ?>

    </p>
    the code is messy as I pulled it from an example I found on the net and have stripped it down to what I need, but it works, just want it to appear in the area where main_page and EZ pages etc appear....

    Any suggestions?

    Cheers (im stuck)

  4. #4
    Join Date
    Jan 2010
    Posts
    28
    Plugin Contributions
    0

    Default Re: Creating a New page

    did you ever figure this one out?

    I'm looking to add pages as well and can't figure it out.

    thanks,

    J

  5. #5
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default

    Quote Originally Posted by joez5374 View Post
    did you ever figure this one out?

    I'm looking to add pages as well and can't figure it out.

    thanks,

    J
    yep, albeit a messy solution but works fine.

    I created an EZ page and put the form here, then the form action was post to a php file that did the processing info sending emails etc, then at the bottom of the php there was a redirect to a second EZ page for a confirmation message.

    I am far from a programmer so tend to just try and chuck things together that do what I need them to do. Give it a go, hope it helps,

    Phil
    Posted via Mobile Device

  6. #6
    Join Date
    Jul 2009
    Location
    Texas
    Posts
    209
    Plugin Contributions
    2

    Default Re: Creating a New page

    Ok.. theres actually a really easy way to create new pages:

    http://www.zen-cart.com/wiki/index.p...ting_new_pages

    Basically the first thing you'll want to do is create a new folder at /includes/modules/pages/MY_PAGE_NAME

    Then include the header_php.php file included from the wiki.

    Now this page is loaded via the template at /includes/templates/YOURTEMPLATE/templates/tpl_MY_PAGE_NAME_default.php

    You can copy a simple page over to this filename to get you started.

    The extra_datafiles and languages I found I didn't need, but if you have a multi-language cart you might want to pay attention there.

 

 

Similar Threads

  1. Help with creating new page
    By ladyk in forum General Questions
    Replies: 6
    Last Post: 9 Apr 2012, 11:57 PM
  2. Creating a new page
    By buzzfever in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Jun 2010, 05:41 AM
  3. Creating a new page
    By beautifymenow in forum Customization from the Admin
    Replies: 1
    Last Post: 27 Apr 2010, 12:48 AM
  4. Creating A New Page
    By gkarasiewicz in forum General Questions
    Replies: 4
    Last Post: 25 Mar 2010, 07:26 PM
  5. creating new page and linking
    By shresthashree in forum General Questions
    Replies: 1
    Last Post: 28 Jun 2009, 07:34 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