Jump to content

Please help me in code modification . . .


suryakmr

Recommended Posts

I am a newbie webdesigner and scripting knowledge is user level.

 

I want to modify the array set in the following code, in our "request a quote form" (downloaded from www.cubescripts.com). It seems easy to my beginner level knowledge but I failed to modify it.

 

The code generates 3 different emails, if all the three check boxes selected. Please modify it to point to one email id now (this website).

 

and give me an option for my future forms that

any one or two or . . . . project types (check boxes selected) should point an email id and

other check boxes (if selected) for another email (appropriate persons would handle the quote request).

 

Thanks in advance!

(please also suggest preparing advanced level safe,free and secure "quote request form" - would be useful to others too)

 

 

 

<?php

//define project types and emails of persons in charge
$project_types = array(
"Foundation"=>"info@unifound.in",
"Construction"=>"info@unifound.in",
"Other works"=>"info@unifound.in"
);

//specify folder with templates, with backslash at the end
$template_folder = './templates/';

//subject of email?
$email_subject = 'New quote submitted';

?>

 

 

 

there is another linked file (quote_sent.php)

which generates the "$project_types" is given below for reference.

<?php
session_start();
error_reporting(0);
include('quote_settings.php');
include('TemplateMailer.class.php');

$temp = new TemplateMailer();

function daj($msg) {
global $template_folder,$temp;
$temp->assign('errmsg',$msg);
$temp->preparemail($template_folder . 'quote_error.tpl.html');
die($temp->body);
}


$name = $_POST['name'];
$company = $_POST['company'];
$captcha = strtolower(trim($_SESSION['captcha']));
$captxt = strtolower(trim($_POST['captxt']));
$email = $_POST['email'];
if ($captcha != $captxt) { daj("Entered text differs from text shown on image. Try again!"); }
if (trim($email) == "") { daj("You have to enter email adress so we can reply to you!"); }
$phone = $_POST['phone'];
$types = $_POST['type'];
if (empty($types)) { daj("You have to select at least one project type!"); }
$description = $_POST['text'];
if (trim($description) == "") { daj("You have to enter description!"); }
$competitors = $_POST['competitors'];
$deadline = $_POST['StartMonth'] . '/' . $_POST['StartDay'] . '/' . $_POST['StartYear'];
if ($deadline == "0/0/0") { $deadline = "doesn't matter"; }


$tip = '';
foreach ($types as $type) {
$tip .= '- ' . $type . "<br />\n";
}
$type = $tip;

$temp->assign('name',$name); 
$temp->assign('company',$company); 
$temp->assign('email',$email); 
$temp->assign('phone',$phone); 
$temp->assign('type',$type); 
$temp->assign('description',$description); 
$temp->assign('deadline',$deadline); 
$temp->assign('competitors',$competitors); 

$temp->preparemail($template_folder . 'quote_mail.tpl.html');

foreach ($types as $iteracija) {
$temp->send($email,$project_types[$iteracija],$email_subject,'');
}

$disya = basename($_SERVER['PHP_SELF']);
$disya = str_replace('.php','.tpl.html',$disya);
$temp->assign("template_file",$disya);
$temp->preparemail($template_folder . $disya); 
echo $temp->body;

?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.