This really isn't the place to post something like this. You need to speak to your hosting provider. Surely they have a phone.
Printable View
Does anyone know if its possible to have an email sent to the customer. If the custom form did this before it does not seem to work any longer. :blink:
Hi,
I was wondering if anybody knows how I can install a very simple contact form in my checkout success page?
Well, I have sort of created the *form* already but I'm not able to make it submit to email.
I would like the form to submit the text entered to my shop email address (in the same way as the ordinary ZenCart contact form) and preferably a copy email to a promotion company that I am working with?
Here is my checkout success page (although I don't know if it's possible to view without being logged in et al):
https://www.lairdofblackwood.com/sho...eckout_success
Any help would be much appreciated.
I have a form that I am currently using on my site for newsletter subscriptions. The top form is for subscribing with double opt-in and when the Subscribe button is clicked an email is sent to me with Subscribe in the subject line and the customer is taken to a page thanking them for subscribing and reminding them that they need to click the link in an email they receive in order to confirm the subscription.
When they click the link in the confirmation email, they are then taken to the welcome page. If email cannot be verified, other pages will load, etc.
The bottom form is a single opt-out and when the Unsubscribe button is clicked an email is sent to me with Unsubscribe in the subject line and a pop up screen appears to the customer stating they've been removed.
So my question is...How can I have ONE form with both the Subscribe and Unsubscribe buttons sending the appropriate subject lines & required information to my specified email address (not the cart owner email) and have all the pages load inside my cart?
Is it possible to modify the band_signup to handle all this?
My current set-up can be seen here:
http://www.countryneedle.net/index.php?main_page=page_3
Thanks!
Hi Diva,
I know this is an old post but you've been an amazing help with my other issues...so I thought I'd see if you could help.
I'm trying to create a form for data submission, I don't know what the heck I'm doing. I've managed to duplicate the contact us page and add the fields I want. However, when I submit I don't know what happens.
I don't need it validated, it would be nice but seeing that I don't know how to code forms it's not necessary. I just want a simple submission form. Any ideas? Thank you!!!
All I can suggest is reading through this thread thoroughly and trying to use the band form files that were posted in this thread as a place to start.. You can use those files and compare them to your modified contact us form to see what you need to include (or remove).. This is how I created the custom survey form I used for my client (which is what brought me to this thread initially)..
Hi Diva,
Thank you for the response. I've changed my files several times. Originally I followed the band signup code...then i realized it was from 2004...the coding was all wrong for the php that zen cart utilizes now.
I've tried to do a search on a band signup add on for the files but I didn't see anything. I did notice a zip file in this thread. Would I download that and make the modifications needed to create a new form for my website?
Thank you again!
There are several zip file examples posted in this thread along with LOT of helpful code and other information on how to tweak your custom forms (including making them work with SSL, working with Captcha mods, getting dropdowns to work -- both from static values and a queried array)..
I know this is a LONG thread, but I suggest reading through ALL of it before you begin.. It's what I did when I first showed up and posted my first question in this thread.. I read this WHOLE thread, made notes of tips and tricks posted by others, took a look at all the ALL of the various zip files and other code that had been posted here BEFORE I began tackling the task of creating a custom form.. If this is new for you, don't shortcut this suggested approach, you will need ALL of this information.. HTH..
Thank you so much. The little bit of information you gave me about the band signup mod helped tremendously! I lost about 4 hours yesterday over this. Ahhhh! I was running myself batty!
I can't thank you enough for your help. :clap:
You're welcome..
That's why I stress two things.. Read the readme files, and read the support thread.. In the time I've been here in this community this has SAVED me more time than I might have "lost" reading through and studying these sources.. I a fan of the "do it right the first time" school of thought.. So I don't take shortcuts (or look for 'em) when it comes to installing mods.. I read, backup, merge, upload, test.. rinse and repeat as necessary.. Good luck.. just take your time, and you'll have a functioning form in no time..
Whew! I've finally got it to work! Yipee!!!
Just one quick question, does anyone know how to align the text fields on the form. For example, I want the first and last name text fields to be on the same line instead of stacking vertically.
I've tried several different codes using div and table commands but neither of them work. Unless I'm doing doing it correctly.
Thank you!
If anyone can help...
Is there a way to create a short message above your form that doesn't flow onto the success page?
Right now I have a small blurb above my form, when it's submitted, the success page includes the previous text as well as the success text.
Any ideas? Thank you!
Hellloooo again.
How do I create an auto-response email for a custom form? Thank you!
Hi everybody,
I have been trying to get this add on work for hours! :cry:
For some reason, when I submit the form only comments field entries can be seen in the email.
(I renamed the band signup to wholesale)
Email is as follows;
wholesale Data Submission:
------------------------------------------------------
Name:
Lastname:
Store Name:
Email Address:
Tax ID:
Adress:
City:
State:
Zip Code:
Country:
Telephone:
Fax:
comments: today is Thursday
------------------------------------------------------
Here is the link for the form;
http://www.luckyeyeusa.com/index.php...page=wholesale
thank you:frusty:
Hi everybody,
I have been trying to get this add on work for hours!
For some reason, when I submit the form only comments field entries can be seen in the email.
(I renamed the band signup to wholesale)
Email is as follows;
wholesale Data Submission:
------------------------------------------------------
Name:
Lastname:
Store Name:
Email Address:
Tax ID:
Adress:
City:
State:
Zip Code:
Country:
Telephone:
Fax:
comments: today is Thursday
------------------------------------------------------
Here is the link for the form;
http://www.luckyeyeusa.com/index.php...page=wholesale
thank you:frusty:
If you are using Upload-point for any for your form uploads, this index.php will allow you to restrict which files can be uploaded. You will be able to specify which extensions you wanted uploaded to the files folder. Just copy this over the original index.php in your www.domainname.com/upload folder. You can see a working form at https://bumblebeebuttons.com/index.p...=submit_design
Hope this helps someone. I thought I would update this for anyone interested.Code:<?php
########################################################################
# Upload-Point 1.62 Beta - Simple Upload System
# Copyright (c)2005-2009 Todd Strattman
# strattman######################
# http://covertheweb.com/upload-point/
# License: LGPL
########################################################################
// Config.php is the main configuration file.
include('config.php');
// Password file.
if (is_file("$datadir/upload_pass.php")) {
include ("$datadir/upload_pass.php");
}
// Language file.
include("lang/$language");
// Name of page for links, title, and logout.
//$logout = "index.php";
//$page_name = "upload";
// Password protection.
// Random string generator.
function randomstring($length){
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
$string = $chars{ rand(0,62) };
for($i=1;$i<$length;$i++){
$string .= $chars{ rand(0,62) };
}
return $string;
}
if ($password_protect == "on") {
session_start();
if(!empty($_POST['pass_hash_upload'])) {
// Crypt, hash, and store password in session.
$_SESSION['pass_hash_upload'] = crypt(md5($_POST['pass_hash_upload']), md5($_POST['pass_hash_upload']));
// Crypt random string with random string seed for agent response.
$string_agent = crypt($_SESSION['random'], $_SESSION['random']);
// Hash crypted random string for random string response.
$string_string = md5($string_agent);
// Hash and concatenate md5/crypted random string and password hash posts.
$string_response = md5($string_string . $_POST['pass_hash2']);
// Concatenate agent and language.
$agent_lang = getenv('HTTP_USER_AGENT') . getenv('HTTP_ACCEPT_LANGUAGE');
// Hash crypted agent/language concatenate with random string seed for check against post.
$agent_response = md5(crypt(md5($agent_lang), $string_agent));
// Check crypted pass against stored pass. Check random string and pass hashed concatenate against post. Check hashed and crypted agent/language concatenate against post.
} if (($_SESSION['pass_hash_upload'] != $upload_password) || ($_POST['pass_string_hash'] != $string_response) || ($_POST['agenthash'] != $agent_response)) {
// Otherwise, give login.
if ($head == "on") {
include("header.php");
}
// Set random string session.
$_SESSION['random'] = randomstring(40);
// Crypt random string with random string seed.
$rand_string = crypt($_SESSION['random'], $_SESSION['random']);
// Concatenate agent and language.
$agent_lang = getenv('HTTP_USER_AGENT').getenv('HTTP_ACCEPT_LANGUAGE');
// Crypt agent and language with random string seed for form submission.
$agent = crypt(md5($agent_lang), $rand_string);
// Form md5 and encrypt javascript.
echo "$p
<b>$l_global13</b>
$p2
<script type=\"text/javascript\" src=\"$datadir/crypt/sha256.js\"></script>
<script type=\"text/javascript\" src=\"$datadir/crypt/md5.js\"></script>
<script type=\"text/javascript\">
function obfuscate() {
document.form1.pass_hash_upload.value = hex_sha256(document.form1.pass_upload.value);
document.form1.pass_hash2.value = hex_md5(document.form1.pass_upload.value);
document.form1.string_hash.value = hex_md5(document.form1.string.value);
document.form1.pass_string_hash.value = hex_md5(document.form1.string_hash.value + document.form1.pass_hash2.value);
document.form1.agenthash.value = hex_md5(document.form1.agent.value);
document.form1.pass_upload.value = \"\";
document.form1.string.value = \"\";
document.form1.agent.value = \"\";
document.form1.jscript.value = \"on\";
return true;
}
</script>
<form action=\"index.php\" method=\"post\" name=\"form1\" onsubmit=\"return obfuscate()\">
$p
<input name=\"jscript\" type=\"hidden\" value=\"off\" />
<input name=\"pass_hash_upload\" type=\"hidden\" value=\"\" />
<input name=\"pass_hash2\" type=\"hidden\" value=\"\" />
<input name=\"string_hash\" type=\"hidden\" value=\"\" />
<input name=\"pass_string_hash\" type=\"hidden\" value=\"\" />
<input name=\"agenthash\" type=\"hidden\" value=\"\" />
<input name=\"string\" type=\"hidden\" value=\"$rand_string\" />
<input name=\"agent\" type=\"hidden\" value=\"$agent\" />
<input type=\"password\" name=\"pass_upload\" />
<input type=\"submit\" value=\"$l_global14\" />
$p2
</form>";
if ($head == "on") {
include("footer.php");
}
exit();
}
} else {
}
// End password protection.
function upload1() {
// Config.php is the main configuration file.
include('config.php');
// Language file.
include("lang/$language");
// Name of page for links, title, and logout.
$logout = "index.php";
$page_name = "upload";
// Include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// Upload file form.
echo "<script type=\"text/javascript\">
function showIcon() {
window.setTimeout('showProgress()', 0);
}
function showProgress() {
document.getElementById('progressImg').style.display = 'inline';
}
</script>
<table class=\"upload\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">
<tr>
<td colspan=\"6\">
<form action=\"index.php\" method=\"post\" enctype=\"multipart/form-data\">
<div id =\"upload_popup\">
<input type=\"hidden\" name=\"cmd\" value=\"upload2\" /> <input type=\"file\" name=\"ftp_file[]\" />
<!-- Ladybugmom - comment out until STOP -->
<br />
<input type=\"hidden\" name=\"cmd\" value=\"upload2\" /> <input type=\"file\" name=\"ftp_file[]\" />
<br />
<input type=\"hidden\" name=\"cmd\" value=\"upload2\" /> <input type=\"file\" name=\"ftp_file[]\" />
<br />
<input type=\"hidden\" name=\"cmd\" value=\"upload2\" /> <input type=\"file\" name=\"ftp_file[]\" />
<br />
<input type=\"hidden\" name=\"cmd\" value=\"upload2\" /> <input type=\"file\" name=\"ftp_file[]\" />
<!-- Ladybugmom - comment out stops here -->
<br /><br />
<input type=\"submit\" name=\"submit\" onclick=\"showIcon();\" value=\"$l_upload1\" />
</div>
<div class=\"progress\" id=\"progressImg\">
<img src=\"$datadir/progress.gif\" alt=\"$l_upload21\" />
</div>
</form>
</td>
</tr>";
// Hide file listing from logged in users.
if ($hide == "on") {
echo "</table>";
} else {
echo "<tr>";
// <td> colspan for rename/delete on/off.
if (($rename_file == "off") && ($delete_file == "off")) {
echo "<td colspan=\"4\">";
} elseif ($rename_file == "off") {
echo "<td colspan=\"5\">";
} elseif ($delete_file == "off") {
echo "<td colspan=\"5\">";
} else {
echo "<td colspan=\"6\">";
}
echo "
<hr />
$p
<b>$l_upload2</b>
$p2
<hr />
</td>
</tr>
</table>
<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" id=\"upload-point\" class=\"tablesorter\">
<thead>
<tr>
<th class=\"uploadlistname\"><b>$l_upload3</b></th>
<th class=\"uploadlistsize\"><b>$l_upload4</b></th>
<th class=\"uploadlistmod\"><b>$l_upload5</b></th>";
// Rename file on/off.
if ($rename_file == "on") {
echo "
<th class=\"uploadlistrename\"><b>$l_upload6</b></th>";
} else {
}
// Delete file on/off.
if ($delete_file == "on") {
echo "
<th class=\"uploadlistdelete\"><b>$l_upload7</b></th>";
} else {
}
echo "<th class=\"uploadlistloc\"><b>$l_upload8</b></th>
</tr>
</thead>
<tfoot>
<tr>
<th class=\"uploadlistname\"><b>$l_upload3</b></th>
<th class=\"uploadlistsize\"><b>$l_upload4</b></th>
<th class=\"uploadlistmod\"><b>$l_upload5</b></th>";
// Rename file on/off.
if ($rename_file == "on") {
echo "
<th class=\"uploadlistrename\"><b>$l_upload6</b></th>";
} else {
}
// Delete file on/off.
if ($delete_file == "on") {
echo "
<th class=\"uploadlistdelete\"><b>$l_upload7</b></th>";
} else {
}
echo "<th class=\"uploadlistloc\"><b>$l_upload8</b></th>
</tr>
</tfoot>
<tbody>";
}
// Path from Upload-Point directory to upload directory
$upload_dir = ($_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name");
// Create upload directory if it doesn't exist.
if (!is_dir($upload_dir)) {
if (!mkdir($upload_dir))
die ("$l_upload11");
if (!chmod($upload_dir,0755))
die ("$l_upload12");
}
// File listing code.
if ($hide == "on") {
} else {
if (is_empty_dir($upload_dir) == true) {
echo "</table>";
} elseif (is_empty_dir($upload_dir) == false) {
// List files in the upload directory.
$dir_handle = opendir($upload_dir);
if ($dir_handle) {
while (false !==($file = readdir($dir_handle))) {
$upload_files = "$upload_dir/$file";
if ((is_file($upload_files)) && ($file!=".htaccess" && $file!=$up_ignore1 && $file!=$up_ignore2 && $file!=$up_ignore3 && $file!=$up_ignore4 && $file!=$up_ignore5)) {
$upload_name_sort[] = $file;
}
}
sort($upload_name_sort);
foreach ($upload_name_sort as $file) {
echo "
<tr>
<td class=\"uploadlistname\">$file</td>
<td class=\"uploadlistsize\">".upload_file_size("$upload_dir/$file")."</td>
<td class=\"uploadlistmod\">".date("m(M) d Y - H:i:s", filemtime("$upload_dir/$file"))."</td>";
// Rename file on/off.
if ($rename_file == "on") {
echo "
<td class=\"uploadlistrename\">
<form action=\"index.php\" method=\"post\">
$p
<input type=\"hidden\" name=\"file\" value=\"$file\" />
<input type=\"hidden\" name=\"pg\" value=\"$pg\" />
<input type=\"hidden\" name=\"cmd\" value=\"upload_rename\" />
<input type=\"text\" name=\"upload_newname\" value=\"$file\" />
<input name=\"submit\" type=\"submit\" value=\"$l_upload6\" />
$p2
</form>
</td>";
} else {
}
// Delete file on/off.
if ($delete_file == "on") {
echo "
<td class=\"uploadlistdelete\">
<form action=\"index.php\" method=\"post\">
$p
<input type=\"hidden\" name=\"file\" value=\"$file\" />
<input type=\"hidden\" name=\"pg\" value=\"$pg\" />
<input type=\"hidden\" name=\"cmd\" value=\"upload_delete\" />
<input name=\"submit\" type=\"submit\" value=\"$l_upload7\" />
$p2
</form>
</td>";
} else {
}
echo "
<td class=\"uploadlistloc\"><a href=\"http://".$_SERVER['HTTP_HOST']."/$fileupload_dir_name/$file\"><i>http://".$_SERVER['HTTP_HOST']."/$fileupload_dir_name/$file</i></a></td>
</tr>";
}
}
closedir($dir_handle);
echo "
</tbody>
</table>
";
}
}
// Include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Upload file function.
function upload2($ftp_file, $upload_type) {
// Config.php is the main configuration file.
include('config.php');
// Language file.
include("lang/$language");
// Name of page for links, title, and logout.
$logout = "index.php";
$page_name = "upload";
// Include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// Upload process.
// Path from domain name to upload directory
$upload_dir = ($_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name/");
$target_path1 = $upload_dir . basename($_FILES['ftp_file']['name'][0]);
$target_path2 = $upload_dir . basename($_FILES['ftp_file']['name'][1]);
$target_path3 = $upload_dir . basename($_FILES['ftp_file']['name'][2]);
$target_path4 = $upload_dir . basename($_FILES['ftp_file']['name'][3]);
$target_path5 = $upload_dir . basename($_FILES['ftp_file']['name'][4]);
$ext1 = end(explode('.', $_FILES['ftp_file']['name'][0]));
$ext2 = end(explode('.', $_FILES['ftp_file']['name'][1]));
$ext3 = end(explode('.', $_FILES['ftp_file']['name'][2]));
$ext4 = end(explode('.', $_FILES['ftp_file']['name'][3]));
$ext5 = end(explode('.', $_FILES['ftp_file']['name'][4]));
// Define allowed file types.
$allowed = array('gif', 'GIF', 'jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG', 'XCF', 'xcf');
// Upload File 1.
if (in_array($ext1, $allowed)) {
if (move_uploaded_file($_FILES['ftp_file']['tmp_name'][0], $target_path1))
{
chmod($upload_dir . basename( $_FILES['ftp_file']['name'][0]), 0644);
echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name'][0]). "$p2";
}
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name'][0]). "$p2";
}
// Upload File 2.
if (in_array($ext2, $allowed)){
if (is_file($_FILES['ftp_file']['tmp_name'][1])) {
if (move_uploaded_file($_FILES['ftp_file']['tmp_name'][1],
$target_path2)) {
chmod($upload_dir . basename( $_FILES['ftp_file']['name'][1]), 0644);
echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name'][1]).
"$p2";
}
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name'][1]).
"$p2";
}
}
// Upload File 3.
if (in_array($ext3, $allowed)){
if (is_file($_FILES['ftp_file']['tmp_name'][2])) {
if (move_uploaded_file($_FILES['ftp_file']['tmp_name'][2],
$target_path3)) {
chmod($upload_dir . basename( $_FILES['ftp_file']['name'][2]), 0644);
echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name'][2]).
"$p2";
}
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name'][2]).
"$p2";
}
}
// Upload File 4.
if (in_array($ext4, $allowed)){
if (is_file($_FILES['ftp_file']['tmp_name'][3])) {
if (move_uploaded_file($_FILES['ftp_file']['tmp_name'][3],
$target_path4)) {
chmod($upload_dir . basename( $_FILES['ftp_file']['name'][3]), 0644);
echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name'][3]).
"$p2";
}
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name'][3]).
"$p2";
}
}
// Upload File 5.
if (in_array($ext5, $allowed)){
if (is_file($_FILES['ftp_file']['tmp_name'][4])) {
if (move_uploaded_file($_FILES['ftp_file']['tmp_name'][4],
$target_path5)) {
chmod($upload_dir . basename( $_FILES['ftp_file']['name'][4]), 0644);
echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name'][4]).
"$p2";
}
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name'][4]).
"$p2";
}
}
// Redirect to upload page.
if ($su == "on") {
$upload_redirect = $admin_redirect;
} else {
$upload_redirect = $edit_redirect;
}
echo "<script type=\"text/javascript\">
<!--
var URL = \"$logout\"
var speed = $upload_redirect
function reload() {
location = URL
}
setTimeout(\"reload()\", speed);
//-->
</script>
$p
$l_upload15
$p2";
//Ladybugmom - comment out stop
// Include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Function to delete files.
function upload_delete($file, $pg) {
// Config.php is the main configuration file.
include('config.php');
// Language file.
include("lang/$language");
// Name of page for links, title, and logout.
$logout = "index.php";
$page_name = "upload";
// Include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// Path to file.
$upload_file_path = ($_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name/$file");
// Delete file
unlink($upload_file_path);
echo "$p<b>$file</b> $l_upload18$p2";
// Redirect to upload page.
if ($su == "on") {
$upload_redirect = $admin_redirect;
} else {
$upload_redirect = $edit_redirect;
}
echo "<script type=\"text/javascript\">
<!--
var URL = \"$logout?pg=$pg\"
var speed = $upload_redirect
function reload() {
location = URL
}
setTimeout(\"reload()\", speed);
//-->
</script>
$p
$l_upload15
$p2";
// Include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Function to rename file.
function upload_rename($file, $upload_newname, $pg) {
// Config.php is the main configuration file.
include('config.php');
// Language file.
include("lang/$language");
// Name of page for links, title, and logout.
$logout = "index.php";
$page_name = "upload";
// Include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
// Path to file.
$upload_file_path = ($_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name/$file");
// Check is file exists and rename it.
if (file_exists($upload_file_path)) {
rename ($upload_file_path, $_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name/$upload_newname") or die ("$l_upload19");
echo "$p<b>$file</b> $l_upload20: <b>$upload_newname</b>.$p2";
}
// Redirect to upload page.
if ($su == "on") {
$upload_redirect = $admin_redirect;
} else {
$upload_redirect = $edit_redirect;
}
echo "<script type=\"text/javascript\">
<!--
var URL = \"$logout?pg=$pg\"
var speed = $upload_redirect
function reload() {
location = URL
}
setTimeout(\"reload()\", speed);
//-->
</script>
$p
$l_upload15
$p2";
// Include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
// Errorless check if directory is empty.
function is_empty_dir($dir) {
if (is_dir($dir)) {
$dl = opendir($dir);
if ($dl) {
while ($name = readdir($dl)) {
if (!is_dir("$dir/$name")) {
return false;
break;
}
}
closedir($dl);
} return true;
} else return true;
}
// Show readable file size function.
function upload_file_size($file) {
$file_size = 0;
if (file_exists($file)) {
$size = filesize($file);
if ($size < 1024) {
$file_size = $size.' Bytes';
} elseif (($size >= 1024) && ($size < 1024000)) {
$file_size = round($size/1024,2).' KB';
} elseif ($size >= 1024000) {
$file_size = round(($size/1024)/1024,2).' MB';
}
}
return $file_size;
}
function logout (){
// Config.php is the main configuration file.
include('config.php');
// Language file.
include("lang/$language");
// Name of page for links, title, and logout.
$logout = "index.php";
$page_name = "upload";
// Include header if "on" in config.php.
if ($head == "on") {
include("header.php");
}
session_destroy ();
session_unset ($_SESSION['pass_hash_upload']);
echo "<script type=\"text/javascript\">
<!--
var URL = \"$logout\"
var speed = $edit_redirect
function reload() {
location = URL
}
setTimeout(\"reload()\", speed);
//-->
</script>";
echo "$p
$l_global10
$p2
$p
$l_global11
$p2";
// Include footer if "on" in config.php.
if ($head == "on") {
include("footer.php");
}
}
switch(@$_REQUEST['cmd']) {
default:
upload1();
break;
case "upload2";
upload2(@$_POST['ftp_file'], @$_POST['upload_type'], $_POST['submit']);
break;
case "upload_delete";
upload_delete($_POST['file'], $_POST['pg']);
break;
case "upload_rename";
upload_rename($_POST['file'], $_POST['upload_newname'], $_POST['pg']);
break;
case "logout";
logout();
break;
}
?>
Thanks,
Ladybugmom :smile:
The above references #173 of this thread.
Thanks,
Ladybugmom :smile:
For a possible antispam-solution in your form, see the following thread:
http://www.zen-cart.com/forum/showthread.php?t=166212
Hi Laybugmom
Just had a quick glance at your latest code and am wondering whether you included a filesize limit for uploads?
Cheers
does it work well on 1.39h?
http://www.zen-cart.com/forum/showthread.php?p=386482
I have not tested the referenced mod in 139h, however, I have used it as a basis to creating several diverse forms, some of which include the upload facility discussed in this thread - all of which work on 139 without problem. I recommend you read this entire thread.
Another form worth comparing is the Return Authorisation mod
http://www.zen-cart.com/index.php?ma...roducts_id=433
thread: http://www.zen-cart.com/forum/showthread.php?t=39212
Hope this helps.
I am having trouble getting the form that I made show up on a new page. I even tried to create a new page and make a simple form using HTML, how can I get it to load onto a page that was not created by default by zen cart?
To be specific, I am getting a 404 error - when I thought I created all of the right files. I even edited the HTML using the define pages editor (so I got my new page to appear in that drop down box, but the page wont load).
Edit #2, just found the Wiki.. Looking at it..
I have created a custom form, all appears OK at the moment except when Send is clicked the page just reloads/refreshes and does Not show the success message.
I copied / edited the contact us files. Any ideas on what I may have missed????
Sounds like something with your 'checkout_success' page.
What does the header_php.php file that is inside modules > pages say (at the bottom).
Make sure the filename is correct
zen_redirect(zen_href_link(FILENAME_YOUR_FILE, 'action=success'));
The words YOUR_FILE should be one of the new file you made.
it is my understanding that the header.php is the file I need to add my form fields to pass thru to email. However I am clueless on the formating. I get some data ok but formating the email sent has me stumped.
I need the data formatted into the email so I know what data is what specific info, any Ideas???????
unbelievable that I finally got my custom form operational without any help. The only prob now is the Title wont display on the page and the title wont show in sidebox. I did manually ad the title to sidebox even tho it does show in Admin/config/define page status:clap:
I am trying to add an email cart form under the shopping cart. I did exactly how this thread started off by basically integrating the "Contact Us" functionality to the "Shopping Cart" functionality...
1) Integrated the form on tpl_shopping_cart_default.php
2) Integrated the html headers by prepending the contact_us to the shopping cart (just after the Breadcrumb navigation bit).
and modifying the contact code such as redirect to shopping_cart & action=success
3) Integrated the definitions by appending the contact form definitions to the /languages/english/shopping_cart.php
I did use the dropdown option but only because I cannot get the contact page to work without it (Previous pr og r amm e r s modifications?) so I am having to use it here too.
The cart is at :http://shop-dev.pacificnorthern.com/...-3-Ring-Tower/
You will need to put something in the cart to see what I am trying to do.
When submit it should have a &success at the end of the URL but does not :(
and hence, no email.
Please any help? I feel so close!
I figured it out. I just needed to reposition my form in the document.
So why do I have to reposition my form? I am not real happy with where it is. How do I get around that?
I love Zencart... just sayin'
I checked form in the source code but did not see any. I tried inserting an extra close form to be safe but still no luck. Is it invisible : ) a ghost in the machine?
This form's working great so far (many thanks to ladybugmom!). The only problem is when I tried limiting the type of file uploads.
I did the above instructions. Here's how my code turned out:
// Upload
// Path from domain name to upload directory and line
$file_ext = basename($_FILES['ftp_file']['name']);
$ext = substr($file_ext, strrpos($file_ext, '.') + 1);
$upload_dir = ($_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name/");
$target_path = $upload_dir . basename( $_FILES['ftp_file']['name']);
if (($ext == "jpg") || ($ext == "jpeg") || ($ext == "psd") || ($ext ==
"pdf") || ($ext == "png") || ($ext == "gif") || ($ext == "tif") || ($ext
== "cdr") || ($ext == "eps") || ($ext == "tiff") || ($ext == "bmp") || ($ext == "ai")) {
if (move_uploaded_file($_FILES['ftp_file']['tmp_name'], $target_path)) {
chmod($upload_dir . basename( $_FILES['ftp_file']['name']), 0644);
echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name']). "$p2";
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name']). "$p2";
}
} else {
echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name']). "$p2";
}
// Redirect to upload page.
But when I finished uploading an image, this message appeared briefly:
Warning: basename() expects parameter 1 to be string, array given in /home/ncom2/public_html/imuniforms.com/upload/index.php on line 307
Warning: basename() expects parameter 1 to be string, array given in /home/ncom2/public_html/imuniforms.com/upload/index.php on line 310
Warning: basename() expects parameter 1 to be string, array given in /home/ncom2/public_html/imuniforms.com/upload/index.php on line 321
There was a problem uploading
Automatically redirecting to the Upload-Page
-----------------------------------------------
Uploading then failed. I have about zero knowledge of php. Can somebody enlighten me?
It would be much appreciated!
Grateful zencarter
Scratch that, alternative in post 217 is much easier....guess I should read through all the posts before I go posting myself. :cool:
How can you add checkbox field and dropdown field to this?
:unsure:
If I did some reading and analyzing the code I would have not needed to post.
:lamo:
:clap:
Ok sorry If I missed it, but I read this entire thread and couldnt find my answer.
Has anyone figured out how to send a confirmation email to the customer after the "you message has been sent" success page?
I have no complaints other than now I want to have a confirmation email sent. I'm using this for a physical catalog request (you can see it here) and I've got it to work perfectly. I get all the correct info and everything lands where its supposed to when its sent. It even checks if the patron is logged into the site to fill in some of the fields. Once the form is submitted, it goes to a page that states that the request has been sent. I would like it to send a confirmation email to the customer thanking them for their interest in the company and so on.
How do I do that? Just need to be pointed in the right direction is all.
Add another zen_mail() function call using the customer's email address instead of yours, and some different content of course.
Hey Jacque,
Your form looks awesome! I'm trying to create something similiar. I see your page is called like other EZ pages via "main_page=SOMETHINGHERE", but I don't really understand how that works. Is "specialorder" a physical file?
Also, do you write to the database? Do you only allow logged in users to submit?
Thanks
Paul
I use code in this thread in conjunction with the About_Us mod in 139h and am wondering whether either needs to be upgarded for v150.
However, due to the diverse applications of the code and mod, I am not seeking any specific solution as yet, but rather am just enquiring into the issue.
TIA
One more question
what zen string do I use to add a standard state dropdown field to my form?
I guess I should contribute to this thread since Dr. Byte was able to help me out so quickly.
------------------------------------------------------------------------------------------------------------
under the header.php file for my form I added the following under the line that says
This is my custom code:PHP Code:
$email_html = nl2br($email_text);
then after the line that starts with "zen_mail(STORE_NAME...." I added the following:PHP Code:
//assemble customer email contents:
$customer_email_text =
CUSTOMER_EMAIL_GREETING . '' . $full_name . ',' . "\n" .
"\n" .
CUSTOMER_EMAIL_BODY_TEXT . "\n" .
"\n" .
CUSTOMER_EMAIL_BODY_QUESTIONS . "\n" .
"\n" .
CUSTOMER_EMAIL_BODY_THANKS . "\n\n" .
$customer_email_text = zen_output_string_protected($customer_email_text);
$customer_email_html = nl2br("\n" . $customer_email_text);
to my languages file I added:PHP Code:
//send email to customer
zen_mail($full_name, $email_address, CUSTOMER_EMAIL_SUBJECT, $customer_email_text, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML' => $customer_email_html), 'catalog_req');
For the html email template (catalog_req) I simply made an html file that consists of a table containing our logo, information (just like a letterhead) and the $EMAIL_MESSAGE_HTML so that it would populate what is defined in the language files.PHP Code:
define('CUSTOMER_EMAIL_GREETING','Hello ');
define('CUSTOMER_EMAIL_SUBJECT', 'Your Catalog is on its way!');
define('CUSTOMER_EMAIL_BODY_TEXT', 'Thank you for your interest in our company and its products. We will mail out a copy of our 2011 catalog for you today and you should be receiving it in a matter of a few days. ');
define('CUSTOMER_EMAIL_BODY_QUESTIONS', 'If you have any questions regarding our company or any of the products you see in the catalog or online, please feel free to contact us through this email address or call us toll free at <removed phone number> .');
define('CUSTOMER_EMAIL_BODY_THANKS', 'Thanks again and have a great day!');
If you want to create or take a look at my files, I can send them to you through email. I dont want to post them here because I originally worked off of a TM file (per my boss) that I completely hacked and virtually started from scratch. So most of the code is for my custom template but I don't mind sharing with those that want it anyway.
:cool: WOW.... this 3 year old post, just MADE MY FREAKIN DAY:clap:
I was able to finally create my contact page with a Dropdown in the Subject Line and have it actually show up in the email correctly.
Thanks so much for posting. This COMPLETE THREAD HAS BEEN HEAVEN SENT!!
Actual Contact Page:
Attachment 10340
This is the Email Rendering after I hit the send button:
Attachment 10341
If you like the *Event Date* little dropdown, I found it on another Zen Thread, but the script can be found at http://www.dynamicdrive.com/dynamici...oncalendar.htm
***OFFICIALLY TIME TO DONATE****
:lookarounBut Where in the World is the Donate Button Now... gotta find it, Not use to this new format yet LOL
------------------------------------------
I just use Appnitro's MachForm system and can create ANY form you care to mention (and embed it on my ZC sites) in under 3 minutes...
Thanks Schoolboy for that info. I will keep that in mind next time. I think I saw it mentioned in this thread when I was reading, but when they said it was a paid form, I quickly let that thought go.
The software costs a few dollars. Think of the HOURS it takes to create one custom form in ZC... If you value your time at $30 / hour, how much have you spent?
And factor in the fact that anyone building sites for clients for money should be able/willing to invest in tools to assist the site build process. There are serveral tools I have invested in to assist me in my efforts.. this sounds like another one I shall investigate investing in.. Saving my time is worth the investment IMHO..
Yep!!!
I took into consideration what schoolboy was saying which was the absolute TRUTH.
I actually went ahead and bought the unlimited version of MachForm.:blush:
MachForm is one of our "lifesaver" additions. This week, we landed a contract where the site needed FIFTEEN CUSTOM FORMS. We had all the forms built, styled, configured, tested and embedded in under 20 minutes.
No, we have not tried to "merge" or "blend" the functions of MachForm to read/write to zencart tables/fields. While it MIGHT be possible, we have been content to use the forms purely as a means of collecting info that our sites' visitors need to communicate to us.
MachForm has its own database - so the data is stored, and can actually be "parsed" into a CSV of XLS file format.
There is an argument for the system having certain FUNCTIONAL limitations, for example... Such as when a person is logged into ZC, their name and email addresses will self-populate in the standard ZC contact_us form. Of course, this will not be recognised in the MachForm forms, because there is no "user login" feature for these forms.
But we don't mind about this... we have not yet had a need to look at "merging" or even "bridging" the databases.
Is the following code, placed at the beginning of includes/modules/pages/myform/header_php.php, all that is needed to ensure a user is logged in before completing form:
ThanksCode:if (!$_SESSION['customer_id']) {
$_SESSION['navigation']->set_snapshot();
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}
I have a fully working custom form to take bulk orders. However, I have hardcoded the dropdown for the products we have in our store. But it is becoming apparent that this is becoming a choir when we take items off the site as active. Is their a function built in zencart to auto populate the product array of products marked as instock only?
I found this function below that is used with country and manufacturers and want to know what needs to be enclosed in the parentheses to array the products.
Code:zen_draw_pull_down_menu
Well, I think this is the place I want to be.... I need a Registration Form for my site. Not to be confused with a Customer Registration. I do fundraising, so I need a form for the Teams/Groups/Charities to register with my site and then I will manually add them to the list so that they are a option when customers are buying and choosing who to give their 20% to. I only need certain info and then for it to be emailed to me once completed. I thought about using a copy of Contact Us page, but I'm concerned I won't know where exactly to edit everything in every file and it will break my site which is almost completed. Again, this will have nothing to do with my actual customers who are there to buy and will register the usual way. Thanks! P.S. does anyone know why I have to type all in one paragraph now in this box instead of hitting return and going to a new line ? This is a recent issue and its driving me nuts! :-)
What I finally did is to use an external form processor, on completion it simply sends the user to a link on Zen Cart. We are an Amateur Radio Organization and do membership apps, renewals and sometimes convention registrations. Works fine 3200 + transactions at this point.
Mel
The purpose of this entire thread is to provide info on what is required to create a custom form for your site.. there is even a set of sample files to help you see how its done. You really will need to read through this thread if you want to tackle this task..