New Zenner
- Join Date:
- Jun 2004
- Posts:
- 45
- Plugin Contributions:
- 0
custom forms - data collection
Just wanted to publicly Thank DrByte for all the wicked help!
This guy ROCKS! ::tup
Views: 221,970
New Zenner
Just wanted to publicly Thank DrByte for all the wicked help!
This guy ROCKS! ::tup
Sensei
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!
New Zenner
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?
New Zenner
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.
New Zenner
Check out the Rolex Repair Form link in the Information sidebox on this page:
Is this functionally what you need?
Zen Follower
Nothing like raising something from the dead...
Is this page somewhere live where I could see what it looks like?
Sensei
FYI: Site used to look like this before it expired.
Zen Follower
Ok, thanks.
New Zenner
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
Zen Follower
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')
2.the message sends. But in the email i only recieve the name, email, message..no book title??
What am i doing wrong?
http://unikids.splay.co.uk/zencart/index.php?main_page=contact_us
Zen Follower
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
Zen Follower
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
Zen Follower
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...
Zen Follower
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....
Zen Follower
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.
New Zenner
Learned a lot from this post! Thanks guys!
New Zenner
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.
New Zenner
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.php?main_page=order_questions
Zen Follower
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.
New Zenner
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.
Tell staff why this post should be reviewed.