PDA

View Full Version : PHP form error


Trés Juicy
03-16-2010, 09:43 PM
Hi guys, I have managed to get a form together aand everything seems to be ok with it, but when you clck submit it redirects you to an error page (http://www.bettaglaze.co.uk/www.bettaglaze.co.uk/sendresults.php) and tells me
Error Summary HTTP Error 404.0 - Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.


and its doing my head in! can anyone tell me where I'm going wrong?

thanks

edbr
03-17-2010, 12:32 AM
a 404 is telling uou the page is not on the server.
in this case the page your 'action ' is pointing to unless you have a r4edirect in your script once the mail is processed. check the paths including any uppercase characters and that there are no blanks in the page name

Trés Juicy
03-17-2010, 08:22 PM
a 404 is telling uou the page is not on the server.
in this case the page your 'action ' is pointing to unless you have a r4edirect in your script once the mail is processed. check the paths including any uppercase characters and that there are no blanks in the page name


the page is definately there, its the homepage for the site and the path is correct, it just points directly at that.

any ideas?

davidj
03-17-2010, 08:49 PM
when i clicked on your example link its resolving to...

http://www.bettaglaze.co.uk/www.bettaglaze.co.uk/sendresults.php

can you spot the error?

Trés Juicy
03-17-2010, 10:06 PM
when i clicked on your example link its resolving to...

http://www.bettaglaze.co.uk/www.bettaglaze.co.uk/sendresults.php

can you spot the error?

er.... yes, but how do I fix this? in the PHP script it just says www.bettaglaze.co.uk (http://www.bettaglaze.co.uk/www.bettaglaze.co.uk/sendresults.php)

davidj
03-17-2010, 10:16 PM
post your php code

Trés Juicy
03-17-2010, 10:29 PM
post your php code


here it is

<?php
$subject = 'Results from Contact form';
$emailadd = 'enquiries@bettaglaze.co.uk';
$url = 'http://www.bettaglaze.co.uk';
$req = '0';
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

I pulled it straight from the tutorials area on this site

edbr
03-18-2010, 03:59 AM
and your form

Trés Juicy
03-18-2010, 12:38 PM
and your form


http://www.bettaglaze.co.uk/form.html

davidj
03-18-2010, 06:32 PM
its not a very good implementation

Table layout

over used flash buttons

You should use CSS to layout your site

Your form is invalid as its being defined in a <td and therefore cannot encapsulate the form controls

also you have this as your form action...
www.bettaglaze.co.uk/sendresults.php (http://www.bettaglaze.co.uk/sendresults.php)

This is not wrong but its unnecessary

Your form action can be set to sendresults.php (http://www.bettaglaze.co.uk/sendresults.php)

davidj
03-18-2010, 06:38 PM
additional

I was wrong about the form tag being invalid as i thought you had used <td's to layout your form but you have not. Its just a large <td

Are you charging that company for this site?

Trés Juicy
03-18-2010, 07:47 PM
its not a very good implementation

Table layout

over used flash buttons

You should use CSS to layout your site

Your form is invalid as its being defined in a <td and therefore cannot encapsulate the form controls

also you have this as your form action...
www.bettaglaze.co.uk/sendresults.php (http://www.bettaglaze.co.uk/sendresults.php)

This is not wrong but its unnecessary

Your form action can be set to sendresults.php (http://www.bettaglaze.co.uk/sendresults.php)

DESTROYED!! I am very new to this!

what is CSS? and how do I make it work then? defined in a <td?? I know what you mean but thats just how it happened


HELP!!

Trés Juicy
03-18-2010, 08:20 PM
double post

davidj
03-18-2010, 09:30 PM
you need to do some training

start here

http://www.w3schools.com/css/default.asp

edbr
03-19-2010, 01:24 AM
try this

<form action="sendresults.php" method="post" enctype="text/plain" name="contact form" id="contact form">
<span class="style15"><span class="style16">Please fill in the form below and click &quot;Submit&quot; and we will call you to arrange the best time for one of our appointments staff to visit and work out the best possible quotation for you. </span><br />
</span>
<br />
<label> First name</label>
<input type="text" name="textfield" />

<span class="style15">
<label>Last name</label>
<input type="text" name="textfield2" />

</span>
<p class="style15">

<label>Address line 1 </label>
<input type="text" name="textfield3" />

<label>Address line 2</label>
<input type="text" name="textfield4" />

</p>
<p class="style15">
<label>Town/City </label>
<input type="text" name="textfield5" />


<label>Post code</label>
<input type="text" name="textfield6" />

</p>
<p class="style15">
<label>Tel no. </label>
<input type="text" name="textfield7" />

</p>

<p class="style15">
<label>Windows</label>
<input type="checkbox" name="checkbox" value="checkbox" />

<label>Doors</label>
<input type="checkbox" name="checkbox2" value="checkbox" />

<label>Roofline</label>

<input type="checkbox" name="checkbox3" value="checkbox" />

<label> Conservatory</label>
<input type="checkbox" name="checkbox4" value="checkbox" />

</p>
<p class="style15">


<input name="contact form" type="submit" id="contact form" value="Submit" />

</p>
</form>

Trés Juicy
03-19-2010, 11:51 AM
try this

<form action="sendresults.php" method="post" enctype="text/plain" name="contact form" id="contact form">
<span class="style15"><span class="style16">Please fill in the form below and click &quot;Submit&quot; and we will call you to arrange the best time for one of our appointments staff to visit and work out the best possible quotation for you. </span><br />
</span>
<br />
<label> First name</label>
<input type="text" name="textfield" />

<span class="style15">
<label>Last name</label>
<input type="text" name="textfield2" />

</span>
<p class="style15">

<label>Address line 1 </label>
<input type="text" name="textfield3" />

<label>Address line 2</label>
<input type="text" name="textfield4" />

</p>
<p class="style15">
<label>Town/City </label>
<input type="text" name="textfield5" />


<label>Post code</label>
<input type="text" name="textfield6" />

</p>
<p class="style15">
<label>Tel no. </label>
<input type="text" name="textfield7" />

</p>

<p class="style15">
<label>Windows</label>
<input type="checkbox" name="checkbox" value="checkbox" />

<label>Doors</label>
<input type="checkbox" name="checkbox2" value="checkbox" />

<label>Roofline</label>

<input type="checkbox" name="checkbox3" value="checkbox" />

<label> Conservatory</label>
<input type="checkbox" name="checkbox4" value="checkbox" />

</p>
<p class="style15">


<input name="contact form" type="submit" id="contact form" value="Submit" />

</p>
</form>


how do I go about using this code?

and, no I am not charging for this site it is for my company

davidj
03-19-2010, 03:51 PM
There is no getting away from it

You are going to have to learn what the code means in order to deliver a professional, accessible, valid website.

you will produce poor quality work if you don't learn the basics. This will reflect on you, your company and its public facing profile.

You could do a lot of damage here

davidj
03-19-2010, 03:58 PM
There is a guy on this forum who teaches the basics 1-2-1

give him a shout. He will help > Corrosive (http://www.dreamweaverclub.com/forum/member.php?u=25422)

tux
03-19-2010, 05:56 PM
This tutorial helped me when I first started learning CSS.

http://www.subcide.com/tutorials/csslayout/index.aspx

Might help you too.

Trés Juicy
03-20-2010, 01:13 PM
Thanks guys, I'm slightly worried about the "doing damage" comment though.....

what do you mean?

tux
03-20-2010, 03:41 PM
I think David is showing concern that without enough knowledge to create a professional looking website, what you do create may look unprofessional. This may reflect on your good name and business and could make your business also seem unprofessional.

Its is good advice he is giving when he say you should undertake some training on the subject of web design and production.

The basics of HTML and CSS should be your starting point, there are links to resources for this already in this thread but google for more info too.

A quick look at the code you have posted shows that you are using tables for your layout. Now days tables are mainly only used for tabular data. Your design seems very boxy as a result. I would do a search for similar companies as yours and see what your competitions websites are like for ideas.

Website layout is now done using CSS and div's. This gives much more flexibility and control and complies with current standards.

Its a learning curve that you are on which can be steep so don't run before you can walk. I am talking from experience as I was in your shoes a year or so ago. This forum is a good resource and its members give very good advice and are very helpful. You will learn quickly from everyone if you want to.

Good luck.

Trés Juicy
03-20-2010, 04:18 PM
Thanks, the trouble I have is I am very busy with the day-to-day stuff and dont have much time for the site. My plan is to get something in place and either improve or replace it at a later date

Corrosive
03-20-2010, 04:28 PM
Thanks, the trouble I have is I am very busy with the day-to-day stuff and dont have much time for the site.

Errrrmmm... Isn't that what pro web designers are for? I don't have time to learn to fit my own windows because I'm busy running a web design business... So I'd call you to do it. :wink:

domedia
03-20-2010, 07:23 PM
Thanks, the trouble I have is I am very busy with the day-to-day stuff and dont have much time for the site. My plan is to get something in place and either improve or replace it at a later date

If you cannot put in time to learn the web languages and best practices, you're not in a position to make a professional website. I'm not saying you won't be able to make a website, but it's more than likely is going to look like something an amateur put together. Have you tried asking your friends in your local community how they got their professional websites made?

edbr
03-21-2010, 12:09 AM
although i agree with the comments the guys have posted , i also understand when/ if budjet is an issue , especially in bad economic times.
so if you really want to do ityour self im sure all the above posters and myself will be willing to help, its what we do but iit will taks time ima afraid.

a website like yours, for a business is a marketing sales tool. you want to find customers, keep them on site make it easy to find sufficient information about you, develop a trust then make the step towards ordering.
I am not saying site design will make the biggest difference between would be customers staying online although it helps in building up a toasty feeling about you in them and there wallets.

davidj
03-21-2010, 11:26 AM
This is what you need to look at to get a measure of quality within your market. If your not developing to compete with these businesses I would get a designer in. Im sure there are grants to help with your online presence

http://www.safestyle-windows.co.uk/
http://www.everest.co.uk/
http://www.anglianhome.co.uk/
http://www.zenithwindows.co.uk/
http://www.weatherseal.co.uk/

///////////////////////

Try here for business grants

http://online.businesslink.gov.uk

Corrosive
03-21-2010, 11:30 AM
That midget from Safestyle freaks me out

davidj
03-21-2010, 11:48 AM
one of the most annoying ads on TV. That and Go Compare

Trés Juicy
03-23-2010, 12:55 PM
ok, but can anyone help me to fix the form I already have??

Corrosive
03-23-2010, 01:03 PM
Try changing;

<form action="www.bettaglaze.co.uk/sendresults.php" method="post" enctype="text/plain" name="contact form" id="contact form">

To plain old;

<form action="sendresults.php" method="post" enctype="text/plain" name="contact form" id="contact form">

As long as the sendresults.php is in the same folder level as your form page.

Trés Juicy
03-23-2010, 01:07 PM
will this work? all I need at the moment is for people to be able to send details to us

Corrosive
03-23-2010, 01:15 PM
Well it is the same solution (give or take) that at least two other people on this thread have suggested. have you tried anything else we've given you?

It is not the way I'd put a contact form together but we are all different and have different methods. There is more than one way to skin a cat with PHP/CSS/HTML.

Corrosive
03-23-2010, 01:20 PM
Otherwise just put a mailto in your page and let people e-mail you what they want rather than the contact form.

Trés Juicy
03-23-2010, 08:13 PM
Thanks for all your help guys, I think I've got it now. Time for for test....

Trés Juicy
03-23-2010, 08:43 PM
grrr... still does not seem to send me the results of the form, but it does at least redirect me back to the home page after clicking submit.

Why is this?

davidj
03-23-2010, 08:45 PM
are you testing on a host or your local machine?

Trés Juicy
03-23-2010, 08:54 PM
are you testing on a host or your local machine?

I am testing on this machine, does that matter?

davidj
03-23-2010, 09:25 PM
To send mail on a local machine (local machine being the machine your developing on and testing on) you need an SMTP server. You dont have any mechanism to send your mail without one. You can download an SMTP server or upload your mail script to a host which supports PHP mail. Id go for the latter option.

Trés Juicy
03-23-2010, 10:18 PM
To send mail on a local machine (local machine being the machine your developing on and testing on) you need an SMTP server. You dont have any mechanism to send your mail without one. You can download an SMTP server or upload your mail script to a host which supports PHP mail. Id go for the latter option.


will it work from another machine?

davidj
03-24-2010, 06:41 AM
It will work from a hosting service which supports php email or a machine which has an SMTP server installed

Trés Juicy
03-24-2010, 11:20 AM
so, this form will not work for some people?

Corrosive
03-24-2010, 11:25 AM
If your server/hosting runs PHP then it will work for all visitors. PHP is server-side. It is javascript that is client side and may only work depending on users and their settings.

davidj
03-24-2010, 11:47 AM
just upload it to your host and test it. If it works for you it will work for everyone

Trés Juicy
03-24-2010, 05:23 PM
does not work!!

Corrosive
03-24-2010, 05:25 PM
And you are sure your host runs PHP?

davidj
03-24-2010, 06:10 PM
create a empty file called info.php

in the file add the following code...

<?php phpinfo(); ?>Upload the file yo your host space

browse for the file

http://[yourdomain.com]/info.php

Report back what happens

Trés Juicy
03-24-2010, 10:13 PM
create a empty file called info.php

in the file add the following code...

<?php phpinfo(); ?>Upload the file yo your host space

browse for the file

http://[yourdomain.com]/info.php

Report back what happens


ok, did that, this is what I get:

http://bettaglaze.co.uk/info.php

by the way I really appreciate all the help you guys have given me!!

edbr
03-25-2010, 12:48 AM
thats tells you php is running on your server

davidj
03-25-2010, 12:49 AM
Ok you have PHP on your host

Ok look at the following code. Create a new blank file call it mail.php and add the following...


<?php

$to = '****'; //<< add your address here
$subject = 'test mail';
$message = 'hello world';
$headers = 'From: test from DWC';

mail($to, $subject, $message, $headers);

?>
Browse for the mail.php file as before and see if you get an email . Make sure you add your email address where i added the **** in between the quotes

Trés Juicy
03-26-2010, 05:04 PM
Ok you have PHP on your host

Ok look at the following code. Create a new blank file call it mail.php and add the following...


<?php

$to = '****'; //<< add your address here
$subject = 'test mail';
$message = 'hello world';
$headers = 'From: test from DWC';

mail($to, $subject, $message, $headers);

?>
Browse for the mail.php file as before and see if you get an email . Make sure you add your email address where i added the **** in between the quotes

Ok, I will do this when I get home. What does it do?:confused::confused::confused::confused:

Corrosive
03-26-2010, 05:07 PM
DavidJ says what it does. Add your e-mail address, upload it, navigate to it and it should send you an e-mail automatically. Let us know if it works or not :)

Trés Juicy
03-29-2010, 07:16 PM
It didn't work!!

davidj
03-29-2010, 07:19 PM
post the code exactly as you have used it

Trés Juicy
03-29-2010, 10:09 PM
here it is

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Quotation form</title>
<style type="text/css">
<!--
.style11 {
color: #FFFFFF;
font-size: 24px;
font-weight: bold;
}
a:hover {
color: #FF0000;
}
.style14 {font-size: 12px}
.style15 {
color: #000099;
font-size: 16px;
}
.style16 {font-size: 18px}
-->
</style>
</head>

<body>
<table width="1243" height="585" border="0">
<tr valign="top">
<td width="337" height="76">< alt="logo" width="302" height="127" /></td>
<td height="97" rowspan="3" align="center" valign="bottom" bgcolor="#FFFFFF">&nbsp;</td>
<td width="195" height="154" rowspan="2" align="center" bgcolor="#FFFFFF"> width="170" height="152" /></td>
</tr>
<tr valign="top">
<td height="76"><a href="certass.html"><img src="certass logo.jpg" alt="certass" width="180" height="69" border="0" /></a></td>
</tr>
<tr valign="top">
<td width="337" rowspan="3"><div align="center">
<p>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" title="windows">
<param name="BGCOLOR" value="" />
<param name="movie" value="button4.swf" />
<param name="quality" value="high" />
<embed src="button4.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" ></embed>
</object>
</p>
</div>
<p align="center">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" title="doors">
<param name="BGCOLOR" value="" />
<param name="movie" value="button6.swf" />
<param name="quality" value="high" />
<embed src="button6.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" ></embed>
</object>
</p>
<p align="center">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" title="patio">
<param name="BGCOLOR" value="" />
<param name="movie" value="button7.swf" />
<param name="quality" value="high" />
<embed src="button7.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" ></embed>
</object>
</p>
<p align="center">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" title="bi - fold">
<param name="BGCOLOR" value="" />
<param name="movie" value="button15.swf" />
<param name="quality" value="high" />
<embed src="button15.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" ></embed>
</object>
</p>
<p align="center">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" title="french">
<param name="BGCOLOR" value="" />
<param name="movie" value="button8.swf" />
<param name="quality" value="high" />
<embed src="button8.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" ></embed>
</object>
</p>
<p align="center">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" title="glass">
<param name="BGCOLOR" value="" />
<param name="movie" value="button9.swf" />
<param name="quality" value="high" />
<embed src="button9.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" ></embed>
</object>
</p>
<p align="center">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" title="roof">
<param name="BGCOLOR" value="" />
<param name="movie" value="button10.swf" />
<param name="quality" value="high" />
<embed src="button10.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" ></embed>
</object>
</p>
<p align="center">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="103" height="24" title="con">
<param name="BGCOLOR" value="" />
<param name="movie" value="button11.swf" />
<param name="quality" value="high" />
<embed src="button11.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="103" height="24" ></embed>
</object>
</p> <div align="center">
<p>&nbsp;</p>
</div></td>
<td width="195" height="21" align="center" bgcolor="#000066">&nbsp;</td>
</tr>
<tr valign="top">
<td height="99" align="center" valign="top" bgcolor="#FFFFFF"><form action="sendresults.php" method="post" enctype="text/plain" name="contact form" id="contact form">
<label><span class="style15"><span class="style16">Please fill in the form below and click &quot;Submit&quot; and we will call you to arrange the best time for one of our appointments staff to visit and work out the best possible quotation for you. </span><br />
<br />
First name
<input type="text" name="textfield" />
</span></label>
<span class="style15">
<label>Last name
<input type="text" name="textfield2" />
</label>
</span>
<p class="style15">
<label>Address line 1
<input type="text" name="textfield3" />
</label>
<label>Address line 2
<input type="text" name="textfield4" />
</label>
</p>
<p class="style15">
<label>Town/City
<input type="text" name="textfield5" />
</label>
<label>Post code
<input type="text" name="textfield6" />
</label>
</p>
<p class="style15">
<label>Tel no.
<input type="text" name="textfield7" />
</label>
</p>
<p class="style15">
<label>
<input type="checkbox" name="checkbox" value="checkbox" />
Windows</label>
<label>
<input type="checkbox" name="checkbox2" value="checkbox" />
Doors</label>
<label>
<input type="checkbox" name="checkbox3" value="checkbox" />
Roofline</label>
<label>
<input type="checkbox" name="checkbox4" value="checkbox" />
Conservatory</label>
</p>
<p class="style15">
<label>
<input name="contact form" type="submit" id="contact form" value="Submit" />
</label>
</p>
</form></td>
<td align="center" bgcolor="#000066">&nbsp;</td>
</tr>


<tr>
<td width="697" height="130" align="center" valign="top" bgcolor="#000066"><div align="center">
<p>&nbsp;</p>
<blockquote>
<p><span class="style11">Bettaglaze provide a wide range of energy efficient UPVC windows &amp; doors to suit any home or budget.</span></p>
</blockquote>
<p>&nbsp;</p>
</div></td>
<td width="195" align="center" bgcolor="#000066">&nbsp;</td>
</tr>
<tr>
<td colspan="3" valign="top"><p align="center" class="style14">Bettaglaze Ltd, 2nd floor, 145 - 157 St John St, London, EC1V 4PY Company registration 6766920 VAT registration 977 5837 48 </p>
<p>&nbsp;</p></td>
</tr>
</table>
</body>
</html>

edbr
03-30-2010, 12:25 AM
PLEASE use code tags when you post code especially when theres a lot of it.
did you upload the code that Davidj gave you and opened that page in your browser?

davidj
03-30-2010, 05:28 AM
I need to see the PHP i gave you to post

did you follow my instruction?

Corrosive
03-30-2010, 06:26 AM
Here, try this link. It might help you out; http://tinyurl.com/ylbvkwj

tux
03-30-2010, 07:50 AM
Here, try this link. It might help you out; http://tinyurl.com/ylbvkwj

lol Corrosive.


Tres Juicy, I think you are not understanding this. You have been given enough info in this thread to do what you are asking. You need to do as Davidj has instructed you. I will try to break it into steps for you.

1. Open a new php page in DW and save it as mail.php
2. Delete everything on the page.
3. Copy the code Davidj gave you to the page.

<?php

$to = '****'; //<< add your address here
$subject = 'test mail';
$message = 'hello world';
$headers = 'From: test from DWC';

mail($to, $subject, $message, $headers);

?>

4. Replace the **** with your email address.
5. Save it and upload it to your host.
6. Browse to the page. http://bettaglaze.co.uk/mail.php I think is your site!
7. Check your email, you should receive an email with 'test mail' as the subjuect, 'hello world' in the message and from 'test from DWC'.

When you have this working come back and we will continue getting your contact form working.

edbr
03-30-2010, 08:34 AM
a
i looked up the server for this site

server:Microsoft-IIS/7.0 x-powered-by:ASP.NET date:Tue, 30 Mar 2010 08:27:41 GMT

edbr
03-30-2010, 09:39 AM
actually scrub that as i was reminded ther was a phpinfo response. follow tux instructions and you will be on you way

Trés Juicy
04-12-2010, 10:27 PM
lol Corrosive.


1. Open a new php page in DW and save it as mail.php
2. Delete everything on the page.
3. Copy the code Davidj gave you to the page.

<?php

$to = '****'; //<< add your address here
$subject = 'test mail';
$message = 'hello world';
$headers = 'From: test from DWC';

mail($to, $subject, $message, $headers);

?>4. Replace the **** with your email address.
5. Save it and upload it to your host.
6. Browse to the page. http://bettaglaze.co.uk/mail.php I think is your site!
7. Check your email, you should receive an email with 'test mail' as the subjuect, 'hello world' in the message and from 'test from DWC'.

When you have this working come back and we will continue getting your contact form working.


ok, finally got some time to try this out and it doesn't work - gutted

any idea why?

edbr
04-13-2010, 01:39 AM
did you edit this line?
$to = '****'; //<< add your address here

tux
04-13-2010, 06:05 AM
Post your code exactly as you used it!

Trés Juicy
04-14-2010, 09:08 PM
Post your code exactly as you used it!


<?php

$to = 'enquiries@bettaglaze.co.uk'; //<< add your address here
$subject = 'test mail';
$message = 'hello world';
$headers = 'From: test from DWC';

mail($to, $subject, $message, $headers);

?>

I also tried:


<?php

$to = enquiries@bettaglaze.co.uk; //<< add your address here
$subject = 'test mail';
$message = 'hello world';
$headers = 'From: test from DWC';

mail($to, $subject, $message, $headers);

?>

tux
04-15-2010, 01:24 AM
I have sent it to you from my server. Let me know if you get it.

Have you uploaded it to your server? When you run the code the screen will stay blank but the email will still be sent.

edbr
04-15-2010, 01:27 AM
mail.php on your site returns this error


IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.and

ModuleFastCgiModule NotificationExecuteRequestHandler HandlerPHP_via_FastCGI Error Code0x00000000
so it looks like this is indeed an IIS server using fastcgi to handle php , i would suggest then the error is there as the code you used is correct. contact your hosting company or use a different method i would say

davidj
04-15-2010, 07:04 AM
if only you had a linux server

Trés Juicy
04-19-2010, 09:27 AM
I have sent it to you from my server. Let me know if you get it.

Have you uploaded it to your server? When you run the code the screen will stay blank but the email will still be sent.

hi Tux, yes I received your message. how?

edbr
04-19-2010, 09:40 AM
he has a linux server so it works . it looks like you might have to seek an alternate way, ie perl t send mail

tux
04-19-2010, 10:00 AM
Yes its your hosting package. You could either change you hosting to a Linux server or find an alternative method to send email.

Who is your hosting with?

Trés Juicy
04-21-2010, 10:42 AM
Yes its your hosting package. You could either change you hosting to a Linux server or find an alternative method to send email.

Who is your hosting with?


123reg.co.uk

what other options do i have?

Corrosive
04-21-2010, 11:27 AM
123reg supply a form2mail script for you to use;

http://www.123-support.co.uk/Answer.aspx?ArticleID=380

tux
04-21-2010, 02:04 PM
123reg supply a form2mail script for you to use;

http://www.123-support.co.uk/Answer.aspx?ArticleID=380

I think that is also for use on their Linux servers so will still not help.

123reg.co.uk

what other options do i have?

I'm sure if you contact 123reg support you should be able to get them to transfer your hosting onto a Linux server.

Corrosive
04-21-2010, 02:52 PM
I think that is also for use on their Linux servers so will still not help.





Aye, good shout mate.

vavi2s
04-21-2010, 06:53 PM
i need help with my php script, in my form it only returns with the title: "Results from form" but nothing else follows.

in the form there are about 6 fields to be filled out and none of them are coming back to the specified email.

the redirect works fine and the email gets sent but the results arent coming with it. also its taking a while for the email to get there.

any help would be awesome as i already have traffic coming to my site and cant afford to lose valuable info. Thanks again!

Corrosive
04-21-2010, 06:55 PM
i need help with my php script, in my form it only returns with the title: "Results from form" but nothing else follows.

in the form there are about 6 fields to be filled out and none of them are coming back to the specified email.

the redirect works fine and the email gets sent but the results arent coming with it. also its taking a while for the email to get there.

any help would be awesome as i already have traffic coming to my site and cant afford to lose valuable info. Thanks again!

I can only imagine what URL your site might be at or what your code might look like ;)