-
custom forms - data collection
Is it at all possible to add a few links that open a set size window containing an outside page to either the information box or the "more_information" box (which used to be the tutorials) ?
I'm totally lost look at this code, and how does the window-open javascript get applied??
Any help would be great as I have two forms that I have to add to my site.
moderator: search keywords added: band_signup bionic
NOTE: A packaged version of this discussion, upgraded for Zen Cart v1.3, can be found in this post:
http://www.zen-cart.com/forum/showth...482#post386482
-
Wayne,
are you wanting to just add links to sideboxes? It seems you've already got that working on your site.
I'm trying to understand what you're trying to accomplish.
-
I see this got moved to it's own post, I hope I didn't do something wrong.
I got close by trying to use a php include that brought in a .inc with the links and the javascript in it but for some reason it would only display above EVERYTHING and if I tried to move it I was getting parsing errors.
I'm not a php guru by any means so I reverted back and am still lost.
esentially I'd like one page linked from the (ex-tutorials) sidebox to open up and contain two paragraphs of text and a link per paragraph that would then open up a sized pop-up containing the sign-up forms, this way I can also implement the error and success pages to work when the formfield is submitted.
Any help by you Zencart Gurus would be greatly appreciated as this is pretty much (hopefully) the last hurdle to this site.
Cheers :)
-
Quote:
Originally posted by DrByte@Jul 14 2004, 06:18 AM
Wayne,
are you wanting to just add links to sideboxes? It seems you've already got that working on your site.
I'm trying to understand what you're trying to accomplish.
Doc, it's basically the fact that I need to be able to open up two forms in either a new page or a pop-up, I figured a pop-up using content that is kept in my main root folder would be easier, because of the link to the form-to-mail file and also the error and success pages, that way these can all be shown in the same window with no extra coding to accomodate the actual cart.
My problem is getting a way to open these two forms in two set windows using javascript within one of the pages that I've added to the sidebox.
Does that make better sense?
-
how complicated are these forms in terms of # of fields, layout, color/presentation, etc?
-
Here's the first on which is still being worked on, the other will be pretty much the same with a few different fields.
first form
-
What I'm thinking is that it could actually be done as a regular Zen Cart page.
You might want to turn off some sideboxes while it's displayed, or maybe not.
If it validates, the email is sent.
If not, then it displays an error.
THe Contact Us page does that now
Of course, it'll take a bit of PHP learning, but could use contact_us as a model to start with.
-
Hmmm, I kind of understand what you mean but don't have a clue how to implement it. :blink:
-
Quote:
Originally posted by waynerd@Jul 14 2004, 02:44 AM
Hmmm, I kind of understand what you mean but don't have a clue how to implement it. :blink:
The contact us form consists of the following files:
Quote:
includes/templates/YOURS/templates/tpl_contact_us_default.php
This one handles the layout, including all the fields you want to collect info for.
I'd take out the "SEND_TO_TEXT" one, and set the default like you do in your regular email form.
Then everything from "ENTRY_NAME" down to "ENTRY_ENQUIRY" would get replaced with your form.
Quote:
/modules/pages/contact_us/header_php.php
This file checks for logic, errors, etc, and if OK, sends the message off to you, by joining all the fields together into the $message variable. It reads info from the form as $_POST['variable'] names.
Quote:
/includes/languages/english/contact_us.php
This contains the display-text variables to be put into your template.
-
-
Okay, I've edited the tpl_contact_us_default.php and saved as tpl_contact_us2_default.php and tpl_contact_us3_default.php to accomodate the two eatra forms.
I then duplicated the other folders and files that are also required by the contact us with the same naming structure, 2 and 3.
Now, do i just open up the sidebox with the present contact us and duplicate the linking code?
-
I've got everything I can think of uploaded and added, added the two extra contact us filenames in the filename file and those show up correctly in the sidebox but they just refresh the mainpage when clicked, what am I missing??
:blink:
-
hang on ... trying something here... ;)
-
I even remembered to add and set contact2 and 3 in the english.php, but didn't make a difference.
-
/includes/extra_datafiles/band_signup.php
Quote:
<?php
// define the filenames used in the project
## define('FILENAME_BAND_SIGNUP', 'band_signup');
?>
-
/includes/languages/english/band_signup.php
Quote:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright © 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright © 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | license AT zen-cart DOT com so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: band_signup.php,v 1.0 2004/07/14 00:00:00 DrByteZen Exp $
//
define('HEADING_TITLE', 'Band Sign-Up');
define('NAVBAR_TITLE', 'Band Sign-Up');
define('TEXT_SUCCESS', 'Your message has been successfully sent.');
define('EMAIL_SUBJECT', 'Sign-up from Bionic Banana!');
define('ENTRY_NAME', 'Full Name:');
define('ENTRY_EMAIL', 'E-Mail Address:');
define('ENTRY_ENQUIRY', 'Message:');
define('SEND_TO_ADDRESS','[email protected]');
define('SIGN_US_UP','SIGN US UP!');
?>
-
/includes/modules/pages/band_signup/header_php.php
Quote:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// +----------------------------------------------------------------------+
// | Copyright © 2003 The zen-cart developers## ## ## ## ## ## ## ## ## ## ## ## ## |
// |## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// | http://www.zen-cart.com/index.php## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// |## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// | Portions Copyright © 2003 osCommerce## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,## ## ## |
// | that is bundled with this package in the file LICENSE, and is## ## ## ## |
// | available through the world-wide-web at the following url:## ## ## ## ## |
// | http://www.zen-cart.com/license/2_0.txt.## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to## ## ## |
// | license AT zen-cart DOT com so we can mail you a copy immediately.## ## ## ## ## |
// +----------------------------------------------------------------------+
// $Id: header_php.php,v 1.0 2004/07/14 00:00:00 DrByteZen Exp $
//
## require(DIR_WS_MODULES . 'require_languages.php');
## $error = false;
## if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
## ## $band_name = zen_db_prepare_input($_POST['band_name']);
## ## $band_genre = zen_db_prepare_input($_POST['band_genre']);
## ## $band_country = zen_db_prepare_input($_POST['band_country']);
## ## $band_state = zen_db_prepare_input($_POST['band_state']);
## ## $band_city = zen_db_prepare_input($_POST['band_city']);
## ## $contact1_firstname = zen_db_prepare_input($_POST['contact1_firstname']);
## ## $contact1_lastname = zen_db_prepare_input($_POST['contact1_lastname']);
## ## $contact1_phone = zen_db_prepare_input($_POST['contact1_phone']);
## ## $contact1_email = zen_db_prepare_input($_POST['contact1_email']);
## ## $contact2_firstname = zen_db_prepare_input($_POST['contact2_firstname']);
## ## $contact2_lastname = zen_db_prepare_input($_POST['contact2_lastname']);
## ## $contact2_phone = zen_db_prepare_input($_POST['contact2_phone']);
## ## $contact2_email = zen_db_prepare_input($_POST['contact2_email']);
## ## $payable_to = zen_db_prepare_input($_POST['payable_to']);
## ## $mailing_address1 = zen_db_prepare_input($_POST['mailing_address1']);
## ## $mailing_address2 = zen_db_prepare_input($_POST['mailing_address2']);
## ## $mailing_city = zen_db_prepare_input($_POST['mailing_city']);
## ## $mailing_state = zen_db_prepare_input($_POST['mailing_state']);
## ## $mailing_zipcode = zen_db_prepare_input($_POST['mailing_zipcode']);
## ## $commments = zen_db_prepare_input($_POST['comments']);
## ## if (!zen_validate_email($contact1_email))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
## ## ## }
## ## if (!zen_not_null($band_name))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the band_name');
## ## ## }
## ## if (!zen_not_null($band_genre))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the band_genre');
## ## ## }
## ## if (!zen_not_null($band_country))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the band_country');
## ## ## }
## ## if (!zen_not_null($band_state))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the band_state');
## ## ## }
## ## if (!zen_not_null($band_city))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the band_city');
## ## ## }
## ## if (!zen_not_null($contact1_firstname))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the contact1_firstname');
## ## ## }
## ## if (!zen_not_null($contact1_lastname))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the contact1_lastname');
## ## ## }
## ## if (!zen_not_null($contact1_phone))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the contact1_phone');
## ## ## }
## ## if (!zen_not_null($contact2_firstname))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the contact2_firstname');
## ## ## }
## ## if (!zen_not_null($contact2_lastname))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the contact2_lastname');
## ## ## }
## ## if (!zen_not_null($contact2_phone))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the contact2_phone');
## ## ## }
## ## if (!zen_not_null($contact2_email))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the contact2_email');
## ## ## }
## ## if (!zen_not_null($payable_to))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the payable_to');
## ## ## }
## ## if (!zen_not_null($mailing_address1))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the mailing_address1');
## ## ## }
## ## if (!zen_not_null($mailing_city))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the mailing_city');
## ## ## }
## ## if (!zen_not_null($mailing_state))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the mailing_state');
## ## ## }
## ## if (!zen_not_null($mailing_zipcode))## {
## ## ## $error = true;
## ## ## $messageStack->add('band_signup', 'Please fill in the mailing_zipcode');
## ## ## }
## ## if (!isset($_POST['termsandconds']) || ($_POST['termsandconds'] != '1')) {
## ## ## $error = true;
## ## ## $messageStack->add_session('band_signup', 'You must accept our terms and conditions before signups can be processed.', 'error');
## ## }
## if ($error == false) {
// grab some customer info if logged in
## ## ## if($_SESSION['customer_id']) {
## ## ## ## $check_customer = $db->Execute("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
## ## ## ## $customer_email= $check_customer->fields['customers_email_address'];
## ## ## ## $customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
## ## ## } else {
## ## ## ## $customer_email='Not logged in';
## ## ## ## $customer_name='Not logged in';
## ## ## }
//assemble the email contents:
## $email_message_contents =
## ## 'band_name:' . "\t" . $band_name . "\n" .
## ## 'band_genre:' . "\t" . $band_genre . "\n" .
## ## 'band_country:' . "\t" . $band_country . "\n" .
## ## 'band_state:' . "\t" . $band_state . "\n" .
## ## 'band_city:' . "\t" . $band_city . "\n" .
## ## 'contact1_firstname:' . "\t" . $contact1_firstname . "\n" .
## ## 'contact1_lastname:' . "\t" . $contact1_lastname . "\n" .
## ## 'contact1_phone:' . "\t" . $contact1_phone . "\n" .
## ## 'contact1_email:' . "\t" . $contact1_email . "\n" .
## ## 'contact2_firstname:' . "\t" . $contact2_firstname . "\n" .
## ## 'contact2_lastname:' . "\t" . $contact2_lastname . "\n" .
## ## 'contact2_phone:' . "\t" . $contact2_phone . "\n" .
## ## 'contact2_email:' . "\t" . $contact2_email . "\n" .
## ## 'payable_to:' . "\t" . $payable_to . "\n" .
## ## 'mailing_address1:' . "\t" . $mailing_address1 . "\n" .
## ## 'mailing_address2:' . "\t" . $mailing_address2 . "\n" .
## ## 'mailing_city:' . "\t" . $mailing_city . "\n" .
## ## 'mailing_state:' . "\t" . $mailing_state . "\n" .
## ## 'mailing_zipcode:' . "\t" . $mailing_zipcode . "\n" .
## ## 'commments:' . "\t" . $commments . "\n" ;
//send the email
## ## zen_mail(STORE_NAME, SEND_TO_ADDRESS, EMAIL_SUBJECT,
## ## ## OFFICE_FROM . "\t" . $name . "\n" .
## ## ## OFFICE_EMAIL . "\t" . $email_address . "\n\n" .
## ## ## '------------------------------------------------------' . "\n\n" .
## ## ## $email_message_contents .## "\n\n" .
## ## ## '------------------------------------------------------' . "\n\n" .
## ## ## OFFICE_USE . "\t" . "\n" .
## ## ## OFFICE_LOGGIN_NAME . "\t" . $customer_name . "\n" .
## ## ## OFFICE_LOGGIN_EMAIL . "\t" . $customer_email . "\n" .
## ## ## OFFICE_IP_ADDRESS . "\t" . $_SERVER['REMOTE_ADDR'] . "\n" .
## ## ## OFFICE_HOST_ADDRESS . "\t" . gethostbyaddr($_SERVER['REMOTE_ADDR']) . "\n" .
## ## ## OFFICE_DATE_TIME . "\t" . date("D M j Y G:i:s T") . "\n",
## ## ## $name, $email_address);
## ## ## zen_redirect(zen_href_link(FILENAME_BAND_SIGNUP, 'action=success'));
## ## ## } //endif $error=false
## } // endif action
// default email and name if customer is logged in
## if($_SESSION['customer_id']) {
## ## ## $check_customer = $db->Execute("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_id = '" . $_SESSION['customer_id'] . "'");
## ## ## $email= $check_customer->fields['customers_email_address'];
## ## ## $firstname= $check_customer->fields['customers_firstname'];
## ## ## $lastname= $check_customer->fields['customers_lastname'];
## }
## $breadcrumb->add(NAVBAR_TITLE);
?>
-
/includes/templates/YOURS/templates/tpl_band_signup_default.php
Quote:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// +----------------------------------------------------------------------+
// | Copyright © 2003 The zen-cart developers## ## ## ## ## ## ## ## ## ## ## ## ## |
// |## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// | http://www.zen-cart.com/index.php## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// |## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// | Portions Copyright © 2003 osCommerce## ## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,## ## ## |
// | that is bundled with this package in the file LICENSE, and is## ## ## ## |
// | available through the world-wide-web at the following url:## ## ## ## ## |
// | http://www.zen-cart.com/license/2_0.txt.## ## ## ## ## ## ## ## ## ## ## ## ## ## |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to## ## ## |
// | license AT zen-cart DOT com so we can mail you a copy immediately.## ## ## ## ## |
// +----------------------------------------------------------------------+
// $Id: tpl_band_signup_default.php,v 1.0 2004/07/14 00:00:00 DrByteZen Exp $
//
?>
<STYLE>
BODY
{scrollbar-face-color: #528607; scrollbar-shadow-color: #3B6201;
scrollbar-highlight-color: #639E0C; scrollbar-3dlight-color: #7BB625;
scrollbar-darkshadow-color: #2C4901; scrollbar-track-color: #3F6A01;
scrollbar-arrow-color: #D8FA2E}
</STYLE>
<?php echo zen_draw_form('band_signup', zen_href_link(FILENAME_BAND_SIGNUP, 'action=send')); ?>
<table## width="100%" border="0" cellspacing="2" cellpadding="2" >
## <tr>
## ## <td class="breadCrumb" colspan="2"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></td>
## </tr>
## <tr>
## ## <td class="pageHeading" colspan="2"><h1><?php echo HEADING_TITLE; ?></h1></td>
## </tr>
<?php
## if ($messageStack->size('band_signup') > 0) {
?>
## <tr>
## ## <td class="main" colspan="2"><?php echo $messageStack->output('band_signup'); ?></td>
## </tr>
<?php
## }
## if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>
## <tr>
## ## <td class="plainBox" colspan="2"><?php echo TEXT_SUCCESS; ?></td>
## </tr>
## <tr>
## ## <td class="main" colspan="2"><?php echo zen_back_link() . zen_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
## </tr>
<?php
## } else {
?>
<tr>
## ## <td colspan="2" valign="top" bgcolor="#336600">Band Information:</td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Band Name:</td>
## ## <td class="main" valign="top"><input type="text" name="band_name"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Band Genre:</td>
## ## <td class="main" valign="top"><input type="text" name="band_genre"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Country of Origin:</td>
## ## <td class="main" valign="top"><input type="text" name="band_country"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">State/Province of Origin:</td>
## ## <td class="main" valign="top"><input type="text" name="band_state"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">City of Origin:</td>
## ## <td class="main" valign="top"><input type="text" name="band_city"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" colspan="2" valign="top" bgcolor="#336600">Band Contacts:</td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Contact 1 First Name:</td>
## ## <td class="main" valign="top"><?php echo zen_draw_input_field('contact1_firstname', $firstname); ?></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Contact 1 Last Name:</td>
## ## <td class="main" valign="top"><?php echo zen_draw_input_field('contact1_lastname', $lastname); ?></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Contact 1 Phone:</td>
## ## <td class="main" valign="top"><input type="text" name="contact1_phone"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Contact 1 Email:</td>
## ## <td class="main" valign="top"><?php echo zen_draw_input_field('contact1_email', ($error ? $_POST['contact1_email'] : $email), ' size="30"'); ?></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Contact 2 First Name:</td>
## ## <td class="main" valign="top"><input type="text" name="contact2_firstname"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Contact 2 Last Name:</td>
## ## <td class="main" valign="top"><input type="text" name="contact2_lastname"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Contact 2 Phone:</td>
## ## <td class="main" valign="top"><input type="text" name="contact2_phone"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Contact 2 Email:</td>
## ## <td class="main" valign="top"><?php echo zen_draw_input_field('contact2_email', $_POST['contact2_email'], ' size="30"'); ?></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" colspan="2" valign="top" bgcolor="#336600">Payment Information:</td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Payment Cheques Payable to:</td>
## ## <td class="main" valign="top"><input type="text" name="payable_to"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Mailing Address 1:</td>
## ## <td class="main" valign="top"><input type="text" name="mailing_address1"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Mailing Address 2: (optional)</td>
## ## <td class="main" valign="top"><input type="text" name="mailing_address2"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">City:</td>
## ## <td class="main" valign="top"><input type="text" name="mailing_city"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">State/Province:</td>
## ## <td class="main" valign="top"><input type="text" name="mailing_state"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Country:</td>
## ## <td class="main" valign="top"><input type="text" name="mailing_country"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Postal/Zip code:</td>
## ## <td class="main" valign="top"><input name="mailing_zipcode" type="text" size="10"></td>
</tr>
<tr>
## ## <td class="plainBoxHeading" align="right" valign="top">Comments (optional):</td>
## ## <td class="main" valign="top"><?php echo zen_draw_textarea_field('comments', 'soft', 40, 4); ?></td>
</tr>
<tr>
## ## <td class="main" colspan="2" align="right" valign="top">I have read and agree to the user agreement:
## ## ## <input type="checkbox" name="termsandconds" value="1"></td>
</tr>
<tr>
## ## <td class="main"><?php echo zen_back_link() . zen_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
## ## <td align="right"><?php echo zen_image_submit('button_send.gif', SIGN_US_UP); ?></td>
## </tr>
<?php
## }
?>
</table></form>
-
Okay Doc, I went through everystep but I'm missing something. What do I have to change the
"
define('BOX_INFORMATION_CONTACT2', 'Band Account Form');"
to to work with the files I just added that you created?
-
In /modules/sideboxes/more_information.php
Code:
## ##$more_information[] = '<a href="' . zen_href_link(FILENAME_BAND_SIGNUP) . '">' . 'Band Signup Form' . '</a>';
Or maybe add a line to english.php saying
Code:
define('BOX_INFORMATION_BAND_SIGNUP','Band Signup Form');
and then use this instead of the other one above:
Code:
## ##$more_information[] = '<a href="' . zen_href_link(FILENAME_BAND_SIGNUP) . '">' . 'Band Signup Form' . '</a>';
(If you're using the "information" box instead of the "more_information" box, then make that change where appropriate.)
-
Mmm Very nice, getting there:
test page
-
Okay, followed all your instructions, page is there, looks good, now I just gotta test it and duplicate it for a slightly different form.
This is great, thanks so much. ::tup
-
You can build in more checks, and can fully-utilize the language file by pulling the text out of the template and into the lang file using constants the same way it's doing it now.
You would do that for the error messages too from header_php.php and swap actual messages for constants.
Also, in the template file, in some places I used Zen functions, in other places I just used what you already had. You might want to continue using Zen functions, and maybe even put in more places where it auto-displays what the user had entered in case they get an error message.... by using the $_POST info... etc...
Hope it helps.
-
It's helped a lot, still a little intimidating but I'm looking at it, If I have any problems I'll be in touch.
You ROCK! Thanks again!
-
Quote:
Originally posted by waynerd@Jul 14 2004, 04:34 AM
It's helped a lot, still a little intimidating but I'm looking at it
Well, keep in mind that what you have there is the result of 2+ hours of coding, customizing, and testing, and it's not really done completely "right" (see previous post).... so, it's not something to take lightly.
However, it does do the job ... right within the store !
-
Yeah, I'm going through it very carefully trying to see everything that needs to be changed for the duplicate form, at this point I think I have it working, except for the header,..looking right now for what I missed.
-
Hey Doc, we have one minor problem,
Since I added the new pages/forms every page that is linked from the information box has a new header of Band Sign-Up, where do I go to fix this one? :huh:
-
Also Doc, I've tested the forms and don't get any messages saying either that the message was sent or that the message failed, i've tried both.
I didn't get a message after the forms were filled out properly.
Any thoughts on this??
Basically everything is there, just have to get the headers to work properly and the forms to send.
Thanks again for all the wicked help.
-
Any Ideas? I'm no php guru so I'm lost.
-
Quote:
Originally posted by waynerd@Jul 14 2004, 05:22 AM
Since I added the new pages/forms every page that is linked from the information box has a new header of Band Sign-Up, where do I go to fix this one?
You've changed the heading title somewhere you shouldn't have.
Search your languages/english.php for "Band Sign-Up" and see where you have it.
The only place you should have it is in something like this: define('BOX_INFORMATION_BAND_SIGNUP','Band Sign-Up');
-
Quote:
Originally posted by waynerd@Jul 14 2004, 05:52 AM
I've tested the forms and don't get any messages saying either that the message was sent or that the message failed, i've tried both.
Something's not right in your files.
I've tested it fine on a base v1.1.4 install here, and it works great.
Perhaps re-grabbing the "header_php.php" and making sure you have it complete would be a starting point.
-
I did make one small edit to the header_php.php and tpl_band_signup_default.php files as posted ... just to change how the checkbox for terms and conditions was handled... there was a bug. To fix it on the second form you made, change the 'value="checked"' on your template to 'value="1"' instead.
-
Quote:
Originally posted by DrByte@Jul 14 2004, 07:08 PM
You've changed the heading title somewhere you shouldn't have.
Search your languages/english.php for "Band Sign-Up" and see where you have it.
The only place you should have it is in something like this: define('BOX_INFORMATION_BAND_SIGNUP','Band Sign-Up');
Hey guys, so the only place in the english.php is shown like this, with the second additional form page listed below it. The odd thing is this says the same as the sidebox link but the header is showing as simply "band Sign-up :blink:
define('BOX_INFORMATION_BAND_SIGNUP', 'Band Sign-Up Form');
define('BOX_INFORMATION_ENDORSEMENTS', 'Band Endorsments Form');
-
Quote:
Originally posted by DrByte@Jul 14 2004, 07:13 PM
I did make one small edit to the header_php.php and tpl_band_signup_default.php files as posted ... just to change how the checkbox for terms and conditions was handled... there was a bug. To fix it on the second form you made, change the 'value="checked"' on your template to 'value="1"' instead.
I've re-copied and uploaded both these files and all the others you posted, I'm still not having any luck with either of these two issues. ::frust
-
This is my modules/sideboxes/information.php this is the only file that looks a little odd to me but is the way you told me to set it up, is this right?
Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright (c) 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | license AT zen-cart DOT com so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: information.php,v 1.2 2004/01/13 15:28:17 wilt Exp $
//
$information[] = '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_BAND_SIGNUP) . '">' . 'Band Signup Form' . '</a>';
// only show GV FAQ when installed
if (MODULE_ORDER_TOTAL_GV_STATUS=='true') {
$information[] = '<a href="' . zen_href_link(FILENAME_GV_FAQ) . '">' . BOX_INFORMATION_GV . '</a>';
}
require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');
$title = BOX_HEADING_INFORMATION;
$left_corner = false;
$right_corner = false;
$right_arrow = false;
$title_link = false;
require($template->get_template_dir('tpl_box_default.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_box_default.php');
?>
-
I found a misnamed file that fixed the Band Sign-up header from displaying on all the extra pages, but now I get HEADING_TITLE as a header on the two new ones?
Where do I check for this one? :blink:
-
The /includes/languages/english/YOURTEMPLATENAME/band_signup.php either doesn't exist or isn't being found. (HEADING_TITLE is defined there, as you'll see in the post of that file's contents earlier).
You could try just placing that file in /includes/languages/english instead.
-
This is the file both in my "custom" template directory and the main english directory.
Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright © 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright © 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | license AT zen-cart DOT com so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: band_signup.php,v 1.0 2004/07/14 00:00:00 DrByteZen Exp $
//
define('HEADING_TITLE', 'Band Sign-Up');
define('NAVBAR_TITLE', 'Band Sign-Up');
define('TEXT_SUCCESS', 'Your message has been successfully sent.');
define('EMAIL_SUBJECT', 'Sign-up from Bionic Banana!');
define('ENTRY_NAME', 'Full Name:');
define('ENTRY_EMAIL', 'E-Mail Address:');
define('ENTRY_ENQUIRY', 'Message:');
define('SEND_TO_ADDRESS','[email protected]');
define('SIGN_US_UP','SIGN US UP!');
?>
still getting the same thing
-
Uh...Waynerd... is this what you have in the template?
Code:
$title = BOX_HEADING_INFORMATION;
and this is your define?
Code:
define('HEADING_TITLE', 'Band Sign-Up');
See the problem? :D
-
Okay yes,
In my "information.php" the code is this:
Code:
<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 The zen-cart developers |
// | |
// | http://www.zen-cart.com/index.php |
// | |
// | Portions Copyright (c) 2003 osCommerce |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available through the world-wide-web at the following url: |
// | http://www.zen-cart.com/license/2_0.txt. |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to |
// | license AT zen-cart DOT com so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// $Id: information.php,v 1.2 2004/01/13 15:28:17 wilt Exp $
//
$information[] = '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_BAND_SIGNUP) . '">' . 'Band Signup Form' . '</a>';
$information[] = '<a href="' . zen_href_link(FILENAME_ENDORSEMENTS) . '">' . 'Band Endorsement Form' . '</a>';
// only show GV FAQ when installed
if (MODULE_ORDER_TOTAL_GV_STATUS=='true') {
$information[] = '<a href="' . zen_href_link(FILENAME_GV_FAQ) . '">' . BOX_INFORMATION_GV . '</a>';
}
require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');
$title = BOX_HEADING_INFORMATION;
$left_corner = false;
$right_corner = false;
$right_arrow = false;
$title_link = false;
require($template->get_template_dir('tpl_box_default.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_box_default.php');
?>
I've tried to change the two variable to BOX_INFORMATION_BAND_Signup to match all the others but that did not work either.
Call me dumb (i'm getting used to it) but I can't see what I'm doing wrong.
-
Just wanted to publicly Thank DrByte for all the wicked help!
This guy ROCKS! ::tup
-
FYI, and for what it's worth, the code was all in place, but a simple typo was made in creating the modules/pages/band_signup/header_php.php file. ... instead of header_php.php, it was mistakenly loaded up as header.php.php.
I share this simply for the benefit of others who might have some troubles when creating custom pages for their site ... filename accuracy is important ;) :P
Nice site Wayne... all the best in your upcoming launch!
-
This thread is really good! I am a complete ZC and PHP novice, and I'm trying to implement something similar to this.
I would like to create a form like the one here, but I need to treat it like an item to be purchased. The intended use is for a youth soccer league online registration. I need to collect some basic information that will get stored in the database and then accept a credit card payment. Is ZC the right solution for this?
-
Do they really need to open in a new window? ...or did you just suggest that so you don't have to mess with the cart code?
You could easily change one of the tutorial pages into a form like I did here if that suits your needs or use my "add additional pages" hack so that it's linked from the main menu.
If you really need it in a separate window though that shouldn't be hard either.
-
Check out the Rolex Repair Form link in the Information sidebox on this page:
http://www.uswatchservice.com
Is this functionally what you need?
-
Nothing like raising something from the dead...
Is this page somewhere live where I could see what it looks like?
-
looks like site registration expired at one point
FYI: Site used to look like this before it expired.
-
-
Thnk you Dr. Byte. I was lost in a miasma of variables trying to do something like this. I kept getting close, but was always missing something. Your generosity in taking the time to help and sharing your experience is deeply appreciated. Your example has fixed all my problems. Thanks so much for your help. ::chrs
-
Re: custom forms - data collection
Quote:
Originally Posted by
DrByte
The contact us form consists of the following files:
This one handles the layout, including all the fields you want to collect info for.
I'd take out the "SEND_TO_TEXT" one, and set the default like you do in your regular email form.
Then everything from "ENTRY_NAME" down to "ENTRY_ENQUIRY" would get replaced with your form.
This file checks for logic, errors, etc, and if OK, sends the message off to you, by joining all the fields together into the $message variable. It reads info from the form as $_POST['variable'] names.
This contains the display-text variables to be put into your template.
Hi, iv done the above...(want to add the field 'book title')
1. On the contact us page it does not display book title?? why is that?
2.the message sends. But in the email i only recieve the name, email, message..no book title??
3. Ohh yeh what do you mean by take out the SEND_TO_TEXT??
What am i doing wrong?
http://unikids.splay.co.uk/zencart/i...age=contact_us
-
Re: custom forms - data collection
this is part of my header file:
$error = false;
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
$name = zen_db_prepare_input($_POST['contactname']);
$booktitle = zen_db_prepare_input($_POST['booktitle']);
$email_address = zen_db_prepare_input($_POST['email']);
$enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));
$zc_validate_email = zen_validate_email($email_address);
if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
// auto complete when logged in
if($_SESSION['customer_id']) {
$sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";
$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
$check_customer = $db->Execute($sql);
$customer_email= $check_customer->fields['customers_email_address'];
$customer_booktitle= $check_customer->fields['customers_booktitle'];
$customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
} else {
$customer_email='Not logged in';
$customer_name='Not logged in';
Do i need to add anything here???
---------------------------
part of my contact us page:
define('ENTRY_NAME', 'Full Name:');
define('ENTRY_BOOKTITLE', 'Book Title:');
define('ENTRY_EMAIL', 'Email Address:');
define('ENTRY_ENQUIRY', 'Message:');
----------------------
part of my tpl_contact_us_default
<?php
// show dropdown if set
if (CONTACT_US_LIST !=''){
?>
<label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT; ?></label>
<?php echo zen_draw_pull_down_menu('send_to', $send_to_array, 0, 'id="send-to"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<?php
}
?>
<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('email', ($error ? $_POST['email'] : $email), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label class="inputLabel" for="booktitle"><?php echo ENTRY_BOOKTITLE; ?></label>
<?php echo zen_draw_input_field('booktitle', $name, ' size="40" id="booktitle"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<label for="enquiry"><?php echo ENTRY_ENQUIRY . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_textarea_field('enquiry', '30', '7', '', 'id="enquiry"'); ?>
</fieldset>
REGARDS
VIK
-
Re: custom forms - data collection
Hi guys...ignore my previous two requests.
i have now basically created a new pop up window on the account default page.
So when they click sell a new window opens which is fine...
iv been through the start of this thread..but do not understand?!?
could you please guide me the correct way so that when a new window is opened a form is dispalyed which can be emailed to me:
form should consist of:
Name, email, book title, ISBN, autour etc
thanxs
-
Re: custom forms - data collection
If anyone has experience with this process could help...?
I'm close! Using the band signup demo, I've got the fields to show up. and the submit button to send the email.
The email shows up with the correct subject, from, and to. Except: it is HTML (which I don't really care about), but the body only says: $EMAIL_MESSAGE_HTML
Anyone have any ideas?
Thanks very much in advance...
-
Re: custom forms - data collection
Okay, so I made some progress....
How do i tell the email to be in text format only. If I switch my global setting to text only, it works perfect.
I would like to keep my global setting to HTML. But allow this email response to be in text....
-
Re: custom forms - data collection
Well, I found the easiest way for me was to duplicate all contact_us related files and rebuild from there...
seemed to work really well.
if someone else needs more help, feel free to pm me.
-
Re: custom forms - data collection
Learned a lot from this post! Thanks guys!
-
Re: custom forms - data collection
How do you change the field that are required to be filled out? I am working on a custom form and not all of the fields will need to be filled out. I copied the band_signup example so am running on that.
-
Re: custom forms - data collection
Nevermind. I figured it out.
However, there is another problem I am having. I have some text forms set-up for someone to enter in their password. In IE submitting the form works fine, however when in FireFox when I submit the form there is a pop-up and asks me to confirm which user I am changing the password for and then lists three of my login names, when I hit 'cancel' the page confirms that the answers have been sent and there are no further problems. How do I fix the pop up in Firefox?
Link to my form, in case anyone wants to take a look:
http://pinkcandydesigns.com/index.ph...rder_questions
-
Re: custom forms - data collection
pcdesigns,
i've heard of a similar problem before. I'll take a look on some forums. in the meantime, your form looks really really good.
congratulations.
-
Re: custom forms - data collection
Thanks!
I did (I think) figure out what the problem is. I've read that in Firefox the form-filler causes that pop-up about the 'confirm which user is changing their password'. Would anyone know if there is a code to use to automatically have that feature turned off and force the user to type their answers instead of using form-filler? I've seen that done with a few websites so I think it can be done.
-
Re: custom forms - data collection
Hi
PLEASE HELP
i can't find the thread supporting a mod i just download it call ;
Contact Information Sidebox
Author: Clyde Jones
Version: 1.0.1
Zen Cart™ Version: v1.3.7
Update added on Jan 31 2007
i did install it and folow the instructions ( as much that i know ) and it is not showing up
www.tiledepot.us/store
-
Re: custom forms - data collection
Wow ... there seem to be a lot of posts on this topic. Just to inform you that I have just finished building the contribution on this subject as it will be published really soon in order to facilitate users task. :wink2:
-
Re: custom forms - data collection
Quote:
Originally Posted by
motti
Hi
PLEASE HELP
i can't find the thread supporting a mod i just download it call ;
Contact Information Sidebox
Author: Clyde Jones
Version: 1.0.1
Zen Cart™ Version: v1.3.7
Update added on Jan 31 2007
i did install it and folow the instructions ( as much that i know ) and it is not showing up
www.tiledepot.us/store
This question should probably be posted in another thread. I would contact Clyde on it for help (if you can't find the thread). He has a lot of contributions and posts available. Or you could just send him a Private Message by going to his profile.
-
1 Attachment(s)
Re: custom forms - data collection
Quote:
Originally Posted by
DrByte
FYI, and for what it's worth, the code was all in place, ...I share this simply for the benefit of others who might have some troubles when creating custom pages for their site ... filename accuracy is important ;) :!
Hi Drbyte
I don't expect that you remember all things from 2004 about custom forms. therefore I put all the made files as your instructions in a zip file attached.
in fact I looked for a way to have a triple combobox in my product pages, but it doesn't work on zen pages. and I didn't get any answer in forum to combobox. I need that my customers fill a form situated in the product page and send it with the order at the same time. I saw this link below"""Check out the Rolex Repair Form link in the Information sidebox on this page: http://www.uswatchservice.com, Is this functionally what you need? ""; and it seems a little bit like what I need in priciples.
I did your instructions but I see nothing on my pages, except of a message on top of the page that says:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\wamp\www\zen\includes\extra_datafiles\band_signup.php:5) in D:\wamp\www\zen\includes\functions\sessions.php on line 108
Warning: Cannot modify header information - headers already sent by (output started at D:\wamp\www\zen\includes\extra_datafiles\band_signup.php:5) in D:\wamp\www\zen\includes\init_includes\init_templates.php on line 78
any idea how can I get this module to work? or is there in between progress in this module for zen 1.3.7, may be that it doen't work because my version in 1.3.7?
-
Re: custom forms - data collection
Quote:
Originally Posted by
reza
Hi Drbyte
I did your instructions but I see nothing on my pages, except of a message on top of the page that says:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\wamp\www\zen\includes\extra_datafiles\band_signup.php:5) in D:\wamp\www\zen\includes\functions\sessions.php on line 108
Warning: Cannot modify header information - headers already sent by (output started at D:\wamp\www\zen\includes\extra_datafiles\band_signup.php:5) in D:\wamp\www\zen\includes\init_includes\init_templates.php on line 78
any idea how can I get this module to work? or is there in between progress in this module for zen 1.3.7, may be that it doen't work because my version in 1.3.7?
HI DrByte
I could see the form now on the frontpage in information and more information boxes, in fact I should add $more_information and f$information string to all two files in the modules directory respectively and also in english.php in language dir.
there is still a problem with the header, I get this message: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\wamp\www\zen\includes\extra_datafiles\band_sign up.php:5) in D:\wamp\www\zen\includes\functions\sessions.php on line 108
Warning: Cannot modify header information - headers already sent by (output started at D:\wamp\www\zen\includes\extra_datafiles\band_sign up.php:5) in D:\wamp\www\zen\includes\init_includes\init_templa tes.php on line 78
, I used your troubleshooting file in downloads to resolve it, but no changes.
when I delete the band_signup.php from extra_datafiles, the error message disapear bu also the form!!!!
any help please?
also is there any possibility to have the contents of the mailed-form in a database? I would like to have this form in product page, where or what do I put the link and what link?
-
Re: custom forms - data collection
Quote:
Originally Posted by
reza
I get this message: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\wamp\www\zen\includes\extra_datafiles\band_sign up.php:5)
You've made a typo of some sort on line 5 -- probably extra spaces in the end of the file.
See this FAQ for an explanation of typical ways this happens:
https://www.zen-cart.com/tutorials/index.php?article=87
You probably should check your other files for extra spaces as well, both top and bottom.
-
Re: custom forms - data collection
Quote:
Originally Posted by
DrByte
You've made a typo of some sort on line 5 -- probably extra spaces in the end of the file.
See this FAQ for an explanation of typical ways this happens:
https://www.zen-cart.com/tutorials/index.php?article=87
You probably should check your other files for extra spaces as well, both top and bottom.
IT's okay now, although all the forms goes below in the page and actually disturb all the page, should I edit tpl_band_signup_default.ph to get the fields nearer together or somewhere else?
also, I see in modules/pages/band_sign/header.php, that database will get the information from the postef form, if its so, it's completely what I looked for, but i don't see and don't know where in the phpmyadmin can I find these posted data, also I don't get the form in email, but I see in admin/tools/archive emalis.
could you please help me for these too?
thanks
-
Re: custom forms - data collection
Quote:
Originally Posted by
reza
IT's okay now, although all the forms goes below in the page and actually disturb all the page, should I edit tpl_band_signup_default.ph to get the fields nearer together or somewhere else?
The template file was built based on Zen Cart v1.2.x, which was current at the time those posts were made (and was based on using tables for layout).
You may have to make a few changes to bring the template into v1.3 compatibility, and thus not end up with layout problems. Perhaps comparing it with your contact_us template might be a starting point.
Quote:
Originally Posted by reza
also, I see in modules/pages/band_sign/header.php, that database will get the information from the postef form, if its so, it's completely what I looked for, but i don't see and don't know where in the phpmyadmin can I find these posted data, also I don't get the form in email, but I see in admin/tools/archive emalis.
If you are having problems sending emails, that is an entirely different issue.
First, make sure the email address in the band_signup file is correct.
If your site isn't sending any emails properly, that should be a different topic in a different thread.
-
Re: custom forms - data collection
Quote:
Originally Posted by
reza
but all messages from frontshop are received in order except of band-singup; while the filled fields of the form of band-signup form is seen in admin email archive;
In your /includes/languages/english/band_signup.php file, what do you have set for an email address?
If it's still set to the default discussed earlier in this thread, then someone ELSE is getting your emails:Perhaps you might try changing that to this:
Code:
define('SEND_TO_ADDRESS', STORE_OWNER_EMAIL_ADDRESS);
... so that the emails go to your mail store email address?
-
Re: custom forms - data collection
I have already changed it to my emails' adresses in hotmail, yahoo and also shop owner to be sure that there is nothing due to the mail servers, results--> no changes;
the point here is that why the mails are sent with header and footer but they can not recognize $EMAIL_MESSAGE_HTML , and in the case of archive manager the whole of the email template statements, !!!
-
Re: custom forms - data collection
In reviewing the code, the problem of the HTML emails not being delivered properly ... is because the code was written for an older version of Zen Cart, which didn't support HTML emails at the time.
The HTML portion of the emails needs to be added to the module.
-
1 Attachment(s)
Re: custom forms - data collection
Here's a packaged version of the module, designed for v1.3.7 ... tested on v1.3.7.
Please consider a donation to the Zen Cart team if you find it useful, as there are numerous hours invested in upgrading and writing and testing this form.
-
Re: custom forms - data collection
There's an error in the packaged module, in the file "tpl_band_signup_default.php".
The first "<div" tag doesn't appear to be closed.
<div class="centerColumn" id="bandSignupDefault">
<h1 id="bandSignupDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
<?php if ($messageStack->size('band_signup') > 0) echo $messageStack->output('band_signup'); ?>
-
Re: custom forms - data collection
Right -- the initial div is closed at the end of the file after everything else in it is displayed.
-
Re: custom forms - data collection
Quote:
Originally Posted by
DrByte
Right -- the initial div is closed at the end of the file after everything else in it is displayed.
Could be. I picked up a little HTML over 10 years ago, and that's about it. I don't even know what a div tag is! :blink:
But I had problems getting it to work, so I downloaded some PHP editors, and both reported an unclosed div tag. So I closed it and now it works.
-
Re: custom forms - data collection
You were right.
I finally went through my template file line by line, fixed a bunch of errors, and now have it working without adding the extra "</div>" tag.
The PHP editor I have still reports an unclosed div, but it works anyway.
And I even fixed some display problems in firefox. :smile:
-
Re: custom forms - data collection
I have modified the form for my customers to make a request for special orders and have run into a snag.
Upon trying to add more fields the page will not display correctly.
Like so.... http://www.freshabundance.com/index....pecial%20order
When I remove the additional fields it returns to the correct display.
Here is the code, what am I missing?
Code:
<div id="specialorderContent" class="content">
<fieldset id="specialorder-Info">
<legend>Special Order Information</legend>
<div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
<br class="clearBoth" />
<label class="inputLabel" for="band_name">Name of the Item:</label>
<?php echo zen_draw_input_field('band_name', zen_output_string_protected($band_name), ' size="30" id="band_name"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="band_genre">Who makes it?:</label>
<?php echo zen_draw_input_field('band_genre', zen_output_string_protected($band_genre), ' size="30" id="band_genre"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<label class="inputLabel" for="band_country">12 Digit UPC Code:</label>
<?php echo zen_draw_input_field('band_country', zen_output_string_protected($band_country), ' size="30" id="band_country"') ; ?> What is a <a href="<?php echo zen_href_link(FILENAME_PAGE_4); ?>" target="_blank">UPC Code?</a>
<label class="inputLabel" for="band_city">Description:</label>
<?php echo zen_draw_textarea_field('band_city',30, 4, zen_output_string_protected($band_city), 'id="band_city"') ; ?>
<!--additional items -->
<label class="inputLabel" for="item2_name">Name of the Item:</label>
<?php echo zen_draw_input_field('item2_name', zen_output_string_protected($item2_name), ' size="30" id="item2_name"') ; ?>
<label class="inputLabel" for="item2_manufacturer">Who makes it?:</label>
<?php echo zen_draw_input_field('item2_manufacturer', zen_output_string_protected($item2_manufacturer), ' size="30" id="item2_manufacturer"') ; ?>
<label class="inputLabel" for="item2_upc">12 Digit UPC Code:</label>
<?php echo zen_draw_input_field('item2_upc', zen_output_string_protected($item2_upc), ' size="30" id="item2_upc"') ; ?> What is a <a href="<?php echo zen_href_link(FILENAME_PAGE_4); ?>" target="_blank">UPC Code?</a>
<label class="inputLabel" for="item2_description">Description:</label>
<?php echo zen_draw_textarea_field('item2_description',30, 4, zen_output_string_protected($item2_description), 'id="item2_description"') ; ?>
</fieldset>
When I get it all done and working, I'll repost it as a zipped file in case anyone wants to clean it up for and use it for their special orders.
Jacque
-
Re: custom forms - data collection
I've made some changes and put the 2nd item in it's own fieldset, it makes it cleaner, though the formating still eludes me...
http://www.freshabundance.com/index....pecial%20order
-
Re: custom forms - data collection
I've figured out the cause, it appears to be related to
Code:
'<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'
Which puts that little red "required information" star there.
So, how do I remove or hide that little star where it is not needed?
-
Re: custom forms - data collection
-
1 Attachment(s)
Re: custom forms - data collection
I've attached my form module based on Band_Signup 1.3. Maybe this will help someone.
-
Re: custom forms - data collection
rsigmon, do you have a web site we can take a peek at it in action?
jacque
-
Re: custom forms - data collection
Quote:
Originally Posted by
jacque427
rsigmon, do you have a web site we can take a peek at it in action?
jacque
I'll post a link once the form page goes live. Right now I'm waiting on corporate approval for some of the text on it.
-
1 Attachment(s)
Re: custom forms - data collection
It was that sneaky <br class="clearBoth" /> that was missing from under each "box".
That being said, the package is attached if anyone has special order requests that are used on their site.
Anyone have ideas or suggestions how I can make the "What is a UPC Code" a popup window?
Jacque
-
Re: custom forms - data collection
The "What is a UPC Code" links seem to have problems. The first and third ones open in new windows, but are the wrong page. The second one goes to the right page, but doesn't open in a new window.
-
Re: custom forms - data collection
In the readme I mentioned that those links would have to be changed. If I knew how or had someone tell me I'd make them popup windows of a UPC code.
But that's a bit beyond me.
jacque
-
Re: custom forms - data collection
Quote:
Originally Posted by
jacque427
In the readme I mentioned that those links would have to be changed. If I knew how or had someone tell me I'd make them popup windows of a UPC code.
But that's a bit beyond me.
jacque
I was talking about the "UPC" links on your website, not in your template file. :smile:
-
Re: custom forms - data collection
Fixed! Thanks for the note and the PM.
Now, if I can just do the popup window it'd be pretty cool.
jacque
-
Re: custom forms - data collection
-
Re: custom forms - data collection
-
Re: custom forms - data collection
Quote:
Originally Posted by
jacque427
Looks great, I think I am going to experiment with this for a link submission form for my links page.
-
Re: custom forms - data collection
Quote:
Originally Posted by
lynnbell2002
Looks great, I think I am going to experiment with this for a link submission form for my links page.
Good luck! Let me know if you need help.
jacque
-
Re: custom forms - data collection
Quote:
Originally Posted by
jacque427
Good luck! Let me know if you need help.
jacque
https://www.serioussecurityonline.co...=special_order
Thanks for your help
let me know if you find mistakes
-
Re: custom forms - data collection
and for sure special thanks to the Dr for the hard work
-
Re: custom forms - data collection
Any body can help me with another form that has some radio buttons?
i asked there
Thanks in advance
-
Re: custom forms - data collection
Anyone?
I tried using formsite.com and that is what i got
https://www.serioussecurityonline.com/ma/ma.html
How can i keep this form on my site with
1. Required fields
2. Submit to my site
If anyone can help how to do it even without installing it within the site (in a blank space - like contact us) just like the link above.
Thanks in advance
-
Re: custom forms - data collection
It takes many many many hours to design a custom form to collect and validate data. Each case is unique, but the concepts are pretty much always the same ... and are outlined in the previous 90 posts, along with sample code.
If you are uncomfortable with making the changes to adapt it to your own use, perhaps posting for paid assistance in the Commercial Help Wanted area may be of benefit to you.
-
Re: custom forms - data collection
Dr
Thanks for your response
I will try to do it myself and if I wont be able to I will consider using the paid help (didn’t know there is).
I thought that if I already have the form and just would like to make the submit and requireds fields to work with the site - it is not much work
Thank you
-
Re: custom forms - data collection
Quote:
Originally Posted by
jacque427
It was that sneaky <br class="clearBoth" /> that was missing from under each "box".
That being said, the package is attached if anyone has special order requests that are used on their site.
Anyone have ideas or suggestions how I can make the "What is a UPC Code" a popup window?
Jacque
Should this special order work with 1.3.8? When I installed all the files and put link in "more information" sidebox it show there as SIDEBOX_LINK_TEXT_specialorder
and the link address is: main_page=FILENAME_specialorder
(when I specify address main_page=specialorder, form shows up.
Thanks
-
Re: custom forms - data collection
Quote:
Originally Posted by
Veronika7747
Should this special order work with 1.3.8? When I installed all the files and put link in "more information" sidebox it show there as SIDEBOX_LINK_TEXT_specialorder
and the link address is: main_page=FILENAME_specialorder
(when I specify address main_page=specialorder, form shows up.
Thanks
O.K. for those who may run into the same problem with Form_specialorder as I did:
to include it in information box this is in the instruction in the read me file:
$information[] = '<a href="' . zen_href_link(FILENAME_specialorder) . '">' . SIDEBOX_LINK_TEXT_specialorder . '</a>';
Just remove FILENAME_
in /indludes/languages/english/extra_definitions/specialorder.php
replace this;
define('SIDEBOX_LINK_TEXT_BAND_SIGNUP','Special Order Request');
WITH THIS:
define('SIDEBOX_LINK_TEXT_specialorder','Special Order Request');