473,804 Members | 3,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Having problems submitting form details to email

1 New Member
Hi,

I'm new to PHP and seem to be having soom problems, I'm getting confused with all the different styles of script writing.
I've created a PHP script to submit details to my email but the details don't forward. PHP is enabled on the windows server host site.

I don't get any errors it just stays on the submit form.

below is the scripts for the submit form and the sendmail form.
Also how do you get validation to work with the scripts?

Thanks.

Matt

<title>Car Sales</title>

</HEAD>
<body marginheight="0 " topmargin="0" link="0000ff" vlink="0000ff" alink="0000ff">

<form method="POST" action=sendmail .php>

<input type="hidden" name="recipient " value="sales@v2 automotivesolut ions.co.uk">
<input type="hidden" name="success_p age" value="www.v2au tomotivesolutio ns.co.uk/success.html">


<input type="hidden" name="required" value="Name,Ema il_address,Car_ Make,Model,Mile age,Registratio n">
<input type="hidden" name="sort" value="Name,tel ephone_number,E mail_address,Mo bile_Number,Car _Make,Model,Mil eage,Registrati on,Transmission ,Condition,Exte rior_Colour,Ser vcie_History">

<BR><BR>
<table bgcolor=#999999 align=center width=500><tr>< td>

<small><font face="Verdana" color="#ffff00" ><b>Please fill in your information <br> <BR></b> </font></font></small>

</td></tr><table bgcolor=#999999 align=center width=500><tr>< td>

<table>
<tr><td><p align="right">< font color="#000000" face="Verdana"> Name: </font></td>
<td bgcolor="#99999 9"><input type="text" size="21" name="Name" maxlength="55"> <font color=red>*</td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Telephone Number: </font></td>
<td><input type="text" size="21" name="Telephone _number" maxlength="55"> </td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Mobile Number: </font></td>
<td bgcolor="#99999 9"><input type="text" size="21" name="Mobile_Nu mber" maxlength="25"> <font color="#ff0000" face="Verdana" size="1"></font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Email Address: </font></td>
<td><input type="text" size="21" name="Email_add ress" maxlength="25"> <font color="#ff0000" face="Verdana" size="1"><font color=red>*</font></td>
</tr>


<tr><td><p align="right">< font color="#000000" face="Verdana"> Car Make: </font></td>
<td><input type="text" size="21" name="Car_Make" maxlength="25"> <font color=red>*<fon t color="#ffffff" face="Verdana" size="1">(i.e. Ford)</font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Model: </font> </td>
<td><input type="text" name="Model" size="21"><font color=red>*<fon t color="#ffffff" face="Verdana" size="1">(i.e. Mondeo)</font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Specification: </font> </td>
<td><input type="text" name="Specifica tion" size="21"><font color=red>*<fon t color="#ffffff" face="Verdana" size="1">(i.e. LX / Ghia)</font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Registration: </font> </td>
<td><input type="text" name="Registrat ion" size="21"><font color="#ffffff" face="Verdana" size="1"></font><font color=red>*</td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Mileage: </font> </td>
<td><input type="text" name="Mileage" size="21"><font color="#ffffff" face="Verdana" size="1"><font color=red>*</font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Exterior Colour: </font> </td>
<td><input type="text" name="Exterior_ Colour" size="21"><font color="#ffffff" face="Verdana" size="1"></font></td>
</tr>

<tr><td BGCOLOR="#99999 9"><p align="right">< font color="#000000" face="Verdana"> Transmission:</font></td>
<td BGCOLOR="#99999 9" NAME="Transmiss ion">
</SELECT><br>
<select name="attn" size="1">
<option value=" Manual ">Manual </option>
<option value=" Automatic ">Automatic </option>
<option value=" Automatic ">Semi Automatic </option>
</select>
<br /><br />

<tr><td BGCOLOR="#99999 9"><p align="right">< font color="#000000" face="Verdana"> Service History:</font></td>
<td BGCOLOR="#99999 9" NAME="Service History">
</SELECT>
<select name="attn" size="1">
<option value=" None ">None </option>
<option value=" Part ">Part </option>
<option value=" Full ">Full </option>
</select>
<br />

<tr><td BGCOLOR="#99999 9"><p align="right">< font color="#000000" face="Verdana"> Condition:</font></td>
<td BGCOLOR="#99999 9" NAME="Condition ">
</SELECT><br>
<select name="attn" size="1">
<option value=" Excellent ">Excellent </option>
<option value=" Good ">Good </option>
<option value=" Average ">Average </option>
<option value=" Poor ">Poor </option>
<option value=" Damaged ">Damaged </option>
</select>
<br /><br />

<tr><td><p align="right">< font color="#000000" face="Verdana"> Additional Comments: </font> </td>
<tr><td><p align="right">< textarea name="notes" rows="6" cols="25"></textarea>
</tr>

<tr></td></form>
</td></table>

<br /><br /><br /><br />

<tr><td><p align="center"> <font color="#000000" face="Verdana"> <font color=red>*</font> indicates a field is required</small></td></tr>

<tr><td><p align="center"< p><input type="submit" value=" &nbsp; &nbsp; &nbsp; &nbsp; Send &nbsp; &nbsp; &nbsp; &nbsp; "> </p>


</center><br><br>
</center></div>
<br>



---------------------------------------------------------------------------------------------------------
sendmail script


<?
$to = "sales@v2automo tivesolutions.c o.uk";
$from_header = "From: $from";
if($contents != "")
{
//send mail - $subject & $sales@v2automo tivesolutions.c o.uk
mail(" v2automotivesol utions.co.uk ") ; $to, $Name, $Telephone_numb er, $Email, $Mobile_Number, $Car_Make, $Model, $Mileage, $Registration, $Transmission,
$Condition, $External_Colou r, $Service_histor y, from_header);
// redirect back to url visitor came from
header( "Location: http://www.mvalarms.co .uk/success.html" );
}
else
{
print("<HTML><B ODY>Error, no comments were submitted!");
print("</BODY></HTML>");
}?>
?>
Jan 12 '07 #1
3 1672
ronverdonk
4,258 Recognized Expert Specialist
You do not really expect our members to read this unformatted bunch of code?
Please read the Posting Guidelines before you post in this forum!

Before you can fill and send your email form you must fill the php variables that you use to populate that email message. So where in sendmail.php do you read the passed variables in the $_POST array and assign them to the php variables?
Another thing: the message body you want to send must be stored in one variable. You cannot send all those different variables separately.

Ronald :cool:
Jan 12 '07 #2
bourbon
2 New Member
The code below is to give you an idea of what to do.


<?
$name = $_POST['Name']; //The Name sent from your form
$email = $_POST['Email_address']; //The Email_address sent from your form
$notes = $_POST['notes'];
exit;
$mymail = "sales@v2automo tivesolutions.c o.uk";
$from = "From: $email";

//send mail - $subject & $sales@v2automo tivesolutions.c o.uk
$todayis = date("F j, Y");
$subject = "Inquiry";
$message = "$todayis \n
Name : $market_type \n
Email : $email \n
$notes
";

$from = "From: $from\r\n";

mail($myemail, $subject, $message, $from); Sends the email

// redirect back to url visitor came from
header( "Location: http://www.mvalarms.co .uk/success.html" );
?>
Jan 12 '07 #3
halles
7 New Member
Hi,

I'm new to PHP and seem to be having soom problems, I'm getting confused with all the different styles of script writing.
I've created a PHP script to submit details to my email but the details don't forward. PHP is enabled on the windows server host site.

I don't get any errors it just stays on the submit form.

below is the scripts for the submit form and the sendmail form.
Also how do you get validation to work with the scripts?

Thanks.

Matt

<title>Car Sales</title>

</HEAD>
<body marginheight="0 " topmargin="0" link="0000ff" vlink="0000ff" alink="0000ff">

<form method="POST" action=sendmail .php>

<input type="hidden" name="recipient " value="sales@v2 automotivesolut ions.co.uk">
<input type="hidden" name="success_p age" value="www.v2au tomotivesolutio ns.co.uk/success.html">


<input type="hidden" name="required" value="Name,Ema il_address,Car_ Make,Model,Mile age,Registratio n">
<input type="hidden" name="sort" value="Name,tel ephone_number,E mail_address,Mo bile_Number,Car _Make,Model,Mil eage,Registrati on,Transmission ,Condition,Exte rior_Colour,Ser vcie_History">

<BR><BR>
<table bgcolor=#999999 align=center width=500><tr>< td>

<small><font face="Verdana" color="#ffff00" ><b>Please fill in your information <br> <BR></b> </font></font></small>

</td></tr><table bgcolor=#999999 align=center width=500><tr>< td>

<table>
<tr><td><p align="right">< font color="#000000" face="Verdana"> Name: </font></td>
<td bgcolor="#99999 9"><input type="text" size="21" name="Name" maxlength="55"> <font color=red>*</td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Telephone Number: </font></td>
<td><input type="text" size="21" name="Telephone _number" maxlength="55"> </td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Mobile Number: </font></td>
<td bgcolor="#99999 9"><input type="text" size="21" name="Mobile_Nu mber" maxlength="25"> <font color="#ff0000" face="Verdana" size="1"></font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Email Address: </font></td>
<td><input type="text" size="21" name="Email_add ress" maxlength="25"> <font color="#ff0000" face="Verdana" size="1"><font color=red>*</font></td>
</tr>


<tr><td><p align="right">< font color="#000000" face="Verdana"> Car Make: </font></td>
<td><input type="text" size="21" name="Car_Make" maxlength="25"> <font color=red>*<fon t color="#ffffff" face="Verdana" size="1">(i.e. Ford)</font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Model: </font> </td>
<td><input type="text" name="Model" size="21"><font color=red>*<fon t color="#ffffff" face="Verdana" size="1">(i.e. Mondeo)</font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Specification: </font> </td>
<td><input type="text" name="Specifica tion" size="21"><font color=red>*<fon t color="#ffffff" face="Verdana" size="1">(i.e. LX / Ghia)</font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Registration: </font> </td>
<td><input type="text" name="Registrat ion" size="21"><font color="#ffffff" face="Verdana" size="1"></font><font color=red>*</td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Mileage: </font> </td>
<td><input type="text" name="Mileage" size="21"><font color="#ffffff" face="Verdana" size="1"><font color=red>*</font></td>
</tr>

<tr><td><p align="right">< font color="#000000" face="Verdana"> Exterior Colour: </font> </td>
<td><input type="text" name="Exterior_ Colour" size="21"><font color="#ffffff" face="Verdana" size="1"></font></td>
</tr>

<tr><td BGCOLOR="#99999 9"><p align="right">< font color="#000000" face="Verdana"> Transmission:</font></td>
<td BGCOLOR="#99999 9" NAME="Transmiss ion">
</SELECT><br>
<select name="attn" size="1">
<option value=" Manual ">Manual </option>
<option value=" Automatic ">Automatic </option>
<option value=" Automatic ">Semi Automatic </option>
</select>
<br /><br />

<tr><td BGCOLOR="#99999 9"><p align="right">< font color="#000000" face="Verdana"> Service History:</font></td>
<td BGCOLOR="#99999 9" NAME="Service History">
</SELECT>
<select name="attn" size="1">
<option value=" None ">None </option>
<option value=" Part ">Part </option>
<option value=" Full ">Full </option>
</select>
<br />

<tr><td BGCOLOR="#99999 9"><p align="right">< font color="#000000" face="Verdana"> Condition:</font></td>
<td BGCOLOR="#99999 9" NAME="Condition ">
</SELECT><br>
<select name="attn" size="1">
<option value=" Excellent ">Excellent </option>
<option value=" Good ">Good </option>
<option value=" Average ">Average </option>
<option value=" Poor ">Poor </option>
<option value=" Damaged ">Damaged </option>
</select>
<br /><br />

<tr><td><p align="right">< font color="#000000" face="Verdana"> Additional Comments: </font> </td>
<tr><td><p align="right">< textarea name="notes" rows="6" cols="25"></textarea>
</tr>

<tr></td></form>
</td></table>

<br /><br /><br /><br />

<tr><td><p align="center"> <font color="#000000" face="Verdana"> <font color=red>*</font> indicates a field is required</small></td></tr>

<tr><td><p align="center"< p><input type="submit" value=" &nbsp; &nbsp; &nbsp; &nbsp; Send &nbsp; &nbsp; &nbsp; &nbsp; "> </p>


</center><br><br>
</center></div>
<br>



---------------------------------------------------------------------------------------------------------
sendmail script


<?
$to = "sales@v2automo tivesolutions.c o.uk";
$from_header = "From: $from";
if($contents != "")
{
//send mail - $subject & $sales@v2automo tivesolutions.c o.uk
mail(" v2automotivesol utions.co.uk ") ; $to, $Name, $Telephone_numb er, $Email, $Mobile_Number, $Car_Make, $Model, $Mileage, $Registration, $Transmission,
$Condition, $External_Colou r, $Service_histor y, from_header);
// redirect back to url visitor came from
header( "Location: http://www.mvalarms.co .uk/success.html" );
}
else
{
print("<HTML><B ODY>Error, no comments were submitted!");
print("</BODY></HTML>");
}?>
?>
Hi!
When using "mail() it's not allow more then 3-4 parameter,
for information , put your data in "$message" value and use html header.

you wil find usefull info at : http://uk2.php.net/manual

http://www.halleswebde sign.com
Jan 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4302
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field that has been modified/clicked the form doesn't always submit. When it does work, a Stored procedure is passed form variables and updates to the db are made. When it doesn't, its as if the form wasn't submitted, it reloads and resets the page, but...
13
40774
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person filling out the form is switching from page to page...without the overhead of extra hits on the server,...
2
6333
by: belzibob | last post by:
I have inherited a table where each row is a <form> Each of these rows has only four columns, those being: 1) Item number 4) Quantity (blank textbox to fill in) 3) Description 4) Add link (to add just this one item. That works fine but, now they want to have a submit button at the top of the page, that when clicked, will submit every form whose quantity
1
3793
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your HTML form to. the actual form-parsing page resides on a server that's uneditable to me since it sits on an inaccessible server. my problem is more irritating than anything; everything double-submits.. when you submit the form, I've forced a...
1
354
by: malcolm | last post by:
Hello, We have a small team building a project that involves some 30 or so c# assembly dlls. It is a client server application with 1 exe as the starting point. The dlls and exe are sharing an assemblyinfo file that has a strong name and version assiciated with it. We are having problems in the way we have been developing. We have made two attempts at this. Attempt 1) In our first attempt, we basically had 1 folder that
5
4611
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post properly to the cgi and users get the message from IE that it "Cannot find server: The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to...
17
2507
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control 'Button19' of type 'Button' must be placed inside a form tag with runat=server Can the IDE not do what it is supposed to do. It seems that it is a fight to make it do anything or did I do something wrong? It would seem silly to have to create a...
7
1211
meenakshia
by: meenakshia | last post by:
hi forum i have been trying to use a way to validate my form but i was unable to use it properly pls rectify my mistakes. i m using input type as a button and calling a function to save the form data. now i want to check if all fields are entered properly before submitting the form the javascript function i m using is
3
2844
by: jerry101 | last post by:
Okay, so I have no knowledge with ASP and I was asked to look at this contact form because the emails aren't delivering. I'll post the whole page of code, because I am unsure at what is what really apart from the common knowledge stuff i.e. the send email to etc, but this wasn't designed by me so I am unsure if it's wrong or right.. If someone could let me know whether there's a problem with the code or if the problem may lay elsewhere...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.