Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2007-03-07, 06:26 AM
Junior Member
 
Join Date: Mar 2004
Posts: 4
vikaspa
Default Please help send enquiry form by email and store details

I have made following form for my client.

This form works fin on web site however

I want to send this via email

In this form an email is sent to
a> A person who fills up the form
b> A person hwaving the web site

I want to
1> Send this form via email
How can I send this form vial email (cut paste the html is OK)
but when person filling up the form (in his / her email) how to acess the server ?

I am using Linux server
and using code in PHP for sending email

2> In case i need to update database
Can i access the server and update details ?

Please help

The form is given below (at present i am not updating the database)

<?
$MODULE="enquirys.php";
$SITENAME="sealretailworld.com";
$SITEMAIL="vikas@prajaktasoftware.com, wrutujas@yahoo.co.in, prajaktasoftware@rediffmail.com";
include("includes/config.inc.php");
include("includes/getsqlvaluestring.inc.php");
include("includes/class.phpmailer.php");
$FormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$FormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

$showform='Y';

if(isset($_POST['Submit'])){

$showform='N';
echo $showform;

$subject="New enquiry has been received on $SITENAME";
$message="Enquiry received on $SITENAME <br><br>
The details are given below<br>
Name: ".$_POST['name']."<br>
Address: ".$_POST['address']."<br>
City: ".$_POST['city']."<br>
State: ".$_POST['state']."<br>
Zip: ".$_POST['zip']."<br>
Phone No: ".$_POST['isdt']."-".$_POST['stdt']."-".$_POST['tel']."<br>
Mobile : ".$_POST['mobile']."<br>
Email Id: ".$_POST['email']."<br>
Location Details: ".$_POST['locationdetail']."<br>
Franchisee City: ".$_POST['franchiseeforcity']."<br>
Carpet Area: ".$_POST['carpetarea']."<br>
Experience of retail Shift: ".$_POST['experience']."<br>
";

$to = $SITEEMAIL;

mail($to, $subject, $message, "From: $emailnReply-To: $emailnContent-Type: text/html;");


$alert="<table cellspacing='0' cellpadding='0'>
<tr>
<td colspan='3'>Dear ".ucwords($_POST['name']).", </td>
</tr>
<tr>
<td colspan='3'><br>
Thank you for visiting our site.<br>
Your enquiry has been received, one of our customer support officers will get back to you shortly. <p><br>
With Best Regards,<br>
Team - ".$SITENAME." <br>
</p>
</td>
</tr>
</table>";

$to=$email;
mail($to, $subject, $message, "From: $emailnReply-To: $emailnContent-Type: text/html;");
$subject = "You had sent following enquiry on $SITENAME";

$to="vikas@prajaktasoftware.com, wrutujas@yahoo.co.in, prajaktasoftware@rediffmail.com";
mail($to, $subject, $message, "From: $emailnReply-To: $emailnContent-Type: text/html;");
}
?>
<html>
<head>
<title>indexnew</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">



<link href="ashokindustry.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--

function formCheck(formobj){
// Enter name of mandatory fields
var fieldRequired = Array("name","address","city","state","zip","tel", "mobile","email","locationdetail","franchiseeforci ty","carpetarea","experience");
// Enter field description to appear in the dialog box
var fieldDescription = Array("Name","Address","City","State","Zip","Tel", "Mobile","email","Location","Franchisee Details","Carpet Area","Experience");
// dialog message
var alertMsg = "Please complete the following fields:n";

var l_Msg = alertMsg.length;

for (var i = 0; i < fieldRequired.length; i++){
var obj = formobj.elements[fieldRequired[i]];
if (obj){
switch(obj.type){
case "select-one":
if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
alertMsg += " - " + fieldDescription[i] + "n";
}
break;
case "select-multiple":
if (obj.selectedIndex == -1){
alertMsg += " - " + fieldDescription[i] + "n";
}
break;
case "text":
case "textarea":
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescription[i] + "n";
}
break;
case "password":
if (obj.value == "" || obj.value == null){
alertMsg += " - " + fieldDescription[i] + "n";
}
break;
default:
}
if (obj.type == undefined){
var blnchecked = false;
for (var j = 0; j < obj.length; j++){
if (obj[j].checked){
blnchecked = true;
}
}
if (!blnchecked){
alertMsg += " - " + fieldDescription[i] + "n";
}
}
}
}

if (alertMsg.length == l_Msg){

return true;
}else{
alert(alertMsg);
return false;
}
}

// -->
</script>
<link href="file:///U|/smart kids/css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (indexnew.psd) -->
<table id="Table_01" width="770" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"> </td>
</tr>

<tr>
<td valign="top"><table width="92%" height="243%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="6%">&nbsp;</td>
<td width="94%" valign="top">
<?php echo $alert; if($showform=='Y'){?>
<form method="post" name="contactus" id="contactus" onsubmit="return formCheck(this)">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="2" id="formtable">
<tr>
<td colspan="3" bgcolor="#F1F1ED" id="toptable"><div align="center">
<p><strong>Franchisee Details Form </strong></p>
</div></td>
</tr>
<tr>
<td colspan="3" align="center" bgcolor="#F1F1ED" id="toptable"></td>
</tr>

<tr id="row">
<td width="28%" bgcolor="#F1F1ED" class="text12bb" id="formcellinfo"><div align="left"><span class="text">Name:<span class="quicklist">*</span></span></div></td>
<td width="72%" colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><input name="name" type="text" class="input" id="name" value="" /> </td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Address</td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<textarea name="address" id="address"></textarea>
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">City</td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<input name="city" type="text" id="city">
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">State</td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<input name="state" type="text" id="state">
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Zip</td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<input name="zip" type="text" id="zip" size="15">
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Tel Phone No. </td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><input name="isdt" type="text" value="" size="4"/>
-
<input name="stdt" type="text" id="stdt" value="" size="7"/>
-
<input name="tel" type="text" value="" size="14"/></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Mobile</td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<input name="mobile" type="text" id="mobile">
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Email Id </td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<input name="email" type="text" id="email">
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Location Details </td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<textarea name="locationdetail" id="locationdetail"></textarea>
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Franchisee for which city </td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<input name="franchiseeforcity" type="text" id="franchiseeforcity">
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Carpet area (Sq. Ft.) </td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<input name="carpetarea" type="text" id="carpetarea" size="12">
</label></td>
</tr>
<tr id="row">
<td bgcolor="#F1F1ED" class="text12bb" id="formcellinfo">Experience of Retail Shift(No.of Years). </td>
<td colspan="2" bgcolor="#F1F1ED" class="text12bb" id="inputcell"><label>
<input name="experience" type="text" id="experience" size="8">
</label></td>
</tr>


<tr id="row">
<td height="64" colspan="3" align="center" bgcolor="#F1F1ED" class="text12bb" id="formcellinfo"><label>
<input name="Submit" type="submit" id="submit" value="Submit" align="middle">
</label></td>
</tr>



<!--
<tr id="row">
<td id="formcellinfo"><span class="text">Best time to call: </span></td>
<td colspan="2" id="inputcell"><select name="time" id="time">
<option value="Morning" >Morning</option>
<option value="Afternoon" selected>Afternoon</option>
<option value="Weekend" >Weekend</option>
</select></td>
</tr>
-->

</table>
</form>
<?php } ?>
</td>
</tr>
</table></td>
</tr>

<tr>
<td valign="bottom" height="100%"><img src="bottom.jpg" width="770" height="17"></td>
</tr>
</table>
<!-- End ImageReady Slices -->
<map name="Map2">
<area shape="rect" coords="612,6,707,325" href="#">
</map>

</body>
</html>
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.5 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.5 (a popular PHP IDE) and NuCoder 2.0 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:54 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.