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=" Send "> </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>");
}?>
?>
3 1672
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:
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" );
?>
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=" Send "> </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
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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,...
|
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
|
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...
|
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
| |
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...
|
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...
|
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
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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();...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |