how to submit form

This is a discussion on "how to submit form" within the Web Page Design section. This forum, and the thread "how to submit form are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 12th, 2007, 22:30
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
how to submit form

Hello everyone,,

I have made a big long application form for a site, and am wondering how i set it so that the filled out form is sent to my client when applicant clicks submit. I know It has someting to do with hidden fields, but what do I put in them and how do I make them apply to submit and send to email address etc...??



tanks

toby
Reply With Quote

  #2 (permalink)  
Old Apr 12th, 2007, 23:17
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

Here is a site that has a php script. Here's another ...http://www.tectite.com/formmailpage.php

I know other's on this site have their favorites but since I'm the first to answer, I'll just going to jot down some resources.

Here's a step by step tutorial...http://www.kirupa.com/forum/showthread.php?t=17313
Those should help, if not, write us back!
Reply With Quote
  #3 (permalink)  
Old Apr 13th, 2007, 07:35
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

Thanks. Just a few q's about it:

Do I copy all that into a new html sheet?

How do I make it apply to my form?






Thanks
Reply With Quote
  #4 (permalink)  
Old Apr 13th, 2007, 13:41
New Member
Join Date: Apr 2007
Location: a H0us3
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to paulka
Talking Re: how to submit form

Quote:
Originally Posted by tobymather View Post
Do I copy all that into a new html sheet?
What do you mean by that?
Here's my code for a form when i had a client who needs accomadation applications emailed to him:
This is the HTML form notice it says "send.php" this is the name of the php file.
PHP: Select all

  <form action="send.phpmethod="post"  name="booking" onsubmit="return formCheck(this);" >
    <
table width="76%" border="0" cellpadding="1">
      <
tr>
        <
td width="18%">First Name</td>
         <
td width="82%"><input name="FirstName" type="text" id="FirstName" size="28" /></td>
      </
tr>
      <
tr>
        <
td>Last Name </td>
        <
td><input name="LastName" type="text" id="LasName" size="28" /></td>
      </
tr>
      <
tr>
        <
td>Email</td>
        <
td><input name="myemail" type="text" id="myemail" size="28" /></td>
      </
tr>
    </
table>

    <
p align="center">
      <
input name="Submit" type="submit" onClick="return checkmail(this.form.myemail)" value="Submit" />
      <
input name="Reset" type=reset value="Reset form" /></p>
  </
form
Next is the PHP file itself called send.php
PHP: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Thank you for contacting us</title>
</head>

<body>
<h1>Thank you for contacting us</h1>

   <!-- your html -->
<!--this is important-->
<?php
///names all the varibles from the feilds
$to       "123@gmail.com"// change to your email address
$name     $_POST['FirstName'];
$name2     $_POST['LastName'];
$email    $_POST['myemail'];
//&anything = $_POST['name_in_form'];




//this is for the email

$d        date('l dS \of F Y h:i:s A');
$sub      "Welcome to Cape Town Responce: HI COSTA";
$headers  "From: $name <$email>\n";  
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";

//all the varibles
//simply put in all the feils here
$mes      "Subject: ".$subject."\n";
$mes     .= "Message: ".$msg."\n" ;
$mes     .= "Name: ".$name."\n";
$mes     .= "Name2: ".$name2."\n";
$mes     .= 'Email: '.$email."\n";




//check all feilds filled in
if (empty($name) || empty($email) || empty($subject) || empty($msg))
{
     echo 
"   <h3>Sorry all fields are required.</h3>";
}
elseif(!
ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"$email)) {
     print 
"   <h3>Sorry the email address you entered looks like it's invalid.</h3>";
}
else
{
     
mail($to$sub$mes$headers);
     print 
"   <h3><center>Thank you ".$name." ".$name2." for contacting us.<br>We will get back to you as soon as posiable</center></h3>";
}
?>

   <!-- your html -->

</body>
</html>
Hope that helps you
regards
Paul
Reply With Quote
  #5 (permalink)  
Old Apr 17th, 2007, 13:12
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

I put all that in, but when I preview in browser i click submit and it opens up a download box asking if i want to open or save send.php.

Here is my html:
Code: Select all
<div id="form">
<h1 class="style8 style6 style6">Online Application Form</h1>
<form action="send.php" method="post"  name="booking" onsubmit="return formCheck(this);" >
  <span class="style6">
  <label> <strong>Full Name</strong><br />
  
  <input type="text" name="textfield" />
  </label>
  </span>
  <p class="style15 style6">
    <label>Adress line 1<br />
    <input type="text" name="textfield2" />
     Adress line 2</label>
    <input type="text" name="textfield3" />
</p>
  <p class="style15 style6">Town/City<br />
    <input type="text" name="textfield4" />
  </p>
  <p class="style15 style6">
    <label>County <br />
    <input type="text" name="textfield5" />
    </label>
Postcode
<input type="text" name="textfield52" />
</p>
  <p class="style15 style6">Telephone<br />
    <input type="text" name="textfield6" />
  </p>
  <p class="style15 style6">Mobile<br />
    <input type="text" name="textfield7" />
  </p>
  <p class="style15 style6">
    <label></label>
    <label>Email <br />
    <input type="text" name="textfield8" />
    </label>
</p>
  <p class="style15 style6">
    <label>Date of Birth<br />
    <input type="text" name="textfield9" />
    </label>
</p>
  <p class="style15 style6">
    <label>Do you have a criminal record?<br />
    <select name="select">
      <option>Yes</option>
      <option>No</option>
    </select>
    </label>
</p>
  <p class="style15 style6">
    <label>Are you having treatment for any of these? <br />
    <select name="select2">
      <option>Mental Depression</option>
      <option>Nervous Breakdown</option>
      <option>Melancholy</option>
      <option>Psychosis</option>
      <option>None of the above</option>
      </select>
    </label>
</p>
  <p class="style15 style6">
    <label>Have you ever had a firearm Certificate refused/revoked?<br />
    <select name="select3">
      <option>Yes</option>
      <option>No</option>
    </select>
    </label>
</p>
  <p class="style15 style6">
    <label>Have you ever had a shotgun Certificate refused/revoked?<br />
    <select name="select4">
      <option>Yes</option>
      <option>No</option>
    </select>
    </label>
</p>
  <p class="style15 style6">Do you currently hold a firearm certificate, and if so, please fill in the details below:</p>
  <span class="style15 style6">
  <label>AUTHORITY <br />
  <input type="text" name="textfield72" />
  </label>
  <label>FAC Number </label>
  <label>
  <input type="text" name="textfield73" />
  </label>
  </span>
  <p class="style15 style6">Do you currently hold a shotgun certificate, and if so, please fill in the details below:</p>
  <span class="style15 style6">
<label>AUTHORITY <br />
  <input type="text" name="textfield74" />
  </label>
FAC Number
<label></label>
<input type="text" name="textfield75" />
  </span>
  <p class="style15 style6">
  <label>Please specify which firearms, if any, are currently in your possesion: </label>
</p>
  <p class="style15 style6">
    <textarea name="textarea5"></textarea>
  </p>
  <p class="style15 style6">
    <label>Are you or have you been a member of any shooting club? If so which one?
    <input type="text" name="textfield76" />
    </label>
</p>
  <p class="style15 style6">
    <label>Proposed By:<br />
    <input type="text" name="textfield77" />
    </label>
</p>
  <p class="style15 style6">
    <label>Seconded By:<br />
    <input type="text" name="textfield78" />
    </label>
</p>
  <p class="style15 style6">
    <label> By ticking the box below you confirm that all the details above have been filled in by you and <br />
are 100% truthful
<input type="checkbox" name="checkbox" value="checkbox" />
    </label>
</p>
  <p class="style15 style6">
    <label>Current date:(dd/mm/yyyy)<br />
    <input type="text" name="textfield79" />
    </label>
</p>
  <p class="style15 style6"><strong>Please send a cheque of &pound;25 for probationary membership to the Tidworth Rifle and Pistol Club , which is fully returnable on rejection of membership. Please enclose a passport-sized photo of yourself, which will be returned attached to your membership card, if membership is granted. </strong></p>
  <p class="style15 style6">Click below to submit form:  </p>
  <span class="style15">
  <label></label>
  </span>
  <span class="style15 style6"><span class="style15">
  </span></span>
  
  <p align="center">
    <input name="Submit" type="submit" onclick="return checkmail(applications.applications@tidworthrpc.co.uk)" value="Submit" />
    <input name="Reset" type=reset value="Reset form" /></p>
</form>
and my php:

Code: Select all
<!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>Untitled Document</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Thank you for contacting us</title>
</head>

<body>
<h1>Thank you for contacting us</h1>

   <!-- your html -->
<!--this is important-->
<?php
///names all the varibles from the feilds
$to       = "applications@tidworthrpc.co.uk"; // change to your email address
$name     = $_POST['FullName'];
$Adress1    = $_POST['AdressLine1'];
$Adress2    = $_POST['AdressLine2'];
$Town    = $_POST['Town/City'];
$county   = $_POST['county'];
$postcode    = $_POST['postcode'];
$telephone    = $_POST['telephone'];
$mobile    = $_POST['mobile'];
$email    = $_POST['email'];
$birthdate    = $_POST['DateOfBirth'];
$criminalRecord    = $_POST['DoYouHaveACriminalRecord'];
$treatments    = $_POST['treatments'];
$firearmrefused    = $_POST['firearmrefused'];
$shotgunrefused    = $_POST['shotgunrefused'];
$firearmauthority    = $_POST['firearmauthority'];
$firearmfac    = $_POST['firearmfac'];
$shotgunauthority    = $_POST['shotgunauthority'];
$shotgunfac    = $_POST['shotgunfac'];
$possesedfirearms    = $_POST['possesedfirearms'];
$shootingclub    = $_POST['shootingclub'];
$proposedby    = $_POST['proposedby'];
$secondedby    = $_POST['secondedby'];
$truthful    = $_POST['truthful'];
$date    = $_POST['CurrentDate'];

//&anything = $_POST['name_in_form'];




//this is for the email

$d        = date('l dS \of F Y h:i:s A');
$sub      = "Welcome to The Tidworth Rifle and Pistol Club Responce: HI COSTA";
$headers  = "From: $name <$email>\n";  
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";

//all the varibles
//simply put in all the feils here
$mes      = "Name: ".$name."\n";
$mes     .= "Adress1: ".$adress1."\n" ;
$mes     .= "Adress2: ".$adress2."\n";
$mes     .= "Town/City: ".$Town/city."\n";
$mes     .= 'County: '.$county."\n";
$mes     .= 'Postcode: '.$postcode."\n";
$mes     .= 'Telephone: '.$telephone."\n";
$mes     .= 'Mobile: '.$mobile."\n";
$mes     .= 'Email: '.$email."\n";
$mes     .= 'DateOfBirth: '.$dateofbirth."\n";
$mes     .= 'CriminalRecord: '.$criminalrecord."\n";
$mes     .= 'treatment: '.$treatment."\n";
$mes     .= 'FirearmCertificateRefused: '.$FirearmCertificateRefused."\n";
$mes     .= 'ShotgunCertificateRefused: '.$ShotgunCertificateRefused."\n";
$mes     .= 'FirearmAuthority: '.$FirearmAuthority."\n";
$mes     .= 'FirearmFAC: '.$FirearmFAC."\n";
$mes     .= 'FShotgunAuthority: '.$ShotgunAuthority."\n";
$mes     .= 'ShotgunFAC: '.$ShotgunFAC."\n";
$mes     .= 'PossesedFirearms: '.$PossesedFirearms."\n";
$mes     .= 'ShootingClub: '.$ShootingClub."\n";
$mes     .= 'ProposedBy: '.$ProposedBy."\n";
$mes     .= 'SecondedBY: '.$SecondedBy."\n";
$mes     .= 'Truthful: '.$truthful."\n";
$mes     .= 'date: '.$date."\n";

else
{
     mail($to, $sub, $mes, $headers);
     print "   <h3><center>Thank you ".$name." ".$name2." for contacting us.<br>We will get back to you as soon as possible</center></h3>";
}
?>

   <!-- your html -->

</body>
</html>
Why is this not working??
Reply With Quote
  #6 (permalink)  
Old Apr 17th, 2007, 13:34
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

Do you have php enabled on your server? Ask your host if you can use it.
Reply With Quote
  #7 (permalink)  
Old Apr 17th, 2007, 13:50
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

Yes, the hosting supports PHP. Is the php alright?
Reply With Quote
  #8 (permalink)  
Old Apr 17th, 2007, 14:02
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

Well ... your names don't match. In your form you have


Code: Select all
<label> <strong>Full Name</strong><br />
  
  <input type="text" name="textfield" />
  </label>
which is wrong BTW ... check [CSS] Customize your form with CSS

but in your php you get

PHP: Select all

$name     $_POST['FullName']; 

it should be the same value that you defined in the name attribute. In this case "textfield"

Apart from that ... is the file saved as send.php?
Reply With Quote
  #9 (permalink)  
Old Apr 17th, 2007, 15:40
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

Hi,

I have a form on the web, but when u fill it in and click submit it says this:


Parse error: parse error, unexpected T_ELSE in \\NAS35ENT\domains\t\mysite.co.uk\user\htdocs\send .php on line 84

the php for send.php is this:
Code: Select all
<!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>Untitled Document</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Thank you for contacting us</title>
</head>

<body>
<h1>Thank you for contacting us</h1>

   <!-- your html -->
<!--this is important-->
<?php
///names all the varibles from the feilds
$to       = "applications@tidworthrpc.co.uk"; // change to your email address
$name     = $_POST['textfield'];
$Adress1    = $_POST['textfield2'];
$Adress2    = $_POST['textfield3'];
$Town    = $_POST['textfield4'];
$county   = $_POST['countytextfield5'];
$postcode    = $_POST['textfield6'];
$telephone    = $_POST['textfield7'];
$mobile    = $_POST['textfield8'];
$email    = $_POST['textfield9'];
$birthdate    = $_POST['textfield10'];
$criminalRecord    = $_POST['select'];
$treatments    = $_POST['select2'];
$firearmrefused    = $_POST['select3'];
$shotgunrefused    = $_POST['select4'];
$firearmauthority    = $_POST['textfield11'];
$firearmfac    = $_POST['textfield12'];
$shotgunauthority    = $_POST['textfield13'];
$shotgunfac    = $_POST['textfield14'];
$possesedfirearms    = $_POST['textfield15'];
$shootingclub    = $_POST['textfield16'];
$proposedby    = $_POST['textfield17'];
$secondedby    = $_POST['textfield18'];
$truthful    = $_POST['checkbox'];
$date    = $_POST['textfield19'];

//&anything = $_POST['name_in_form'];




//this is for the email

$d        = date('l dS \of F Y h:i:s A');
$sub      = "Welcome to The Tidworth Rifle and Pistol Club Responce: HI COSTA";
$headers  = "From: $name <$email>\n";  
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";

//all the varibles
//simply put in all the feils here
$mes      = "Name: ".$name."\n";
$mes     .= "Adress1: ".$adress1."\n" ;
$mes     .= "Adress2: ".$adress2."\n";
$mes     .= "Town/City: ".$Town/city."\n";
$mes     .= 'County: '.$county."\n";
$mes     .= 'Postcode: '.$postcode."\n";
$mes     .= 'Telephone: '.$telephone."\n";
$mes     .= 'Mobile: '.$mobile."\n";
$mes     .= 'Email: '.$email."\n";
$mes     .= 'DateOfBirth: '.$dateofbirth."\n";
$mes     .= 'CriminalRecord: '.$criminalrecord."\n";
$mes     .= 'treatment: '.$treatment."\n";
$mes     .= 'FirearmCertificateRefused: '.$FirearmCertificateRefused."\n";
$mes     .= 'ShotgunCertificateRefused: '.$ShotgunCertificateRefused."\n";
$mes     .= 'FirearmAuthority: '.$FirearmAuthority."\n";
$mes     .= 'FirearmFAC: '.$FirearmFAC."\n";
$mes     .= 'FShotgunAuthority: '.$ShotgunAuthority."\n";
$mes     .= 'ShotgunFAC: '.$ShotgunFAC."\n";
$mes     .= 'PossesedFirearms: '.$PossesedFirearms."\n";
$mes     .= 'ShootingClub: '.$ShootingClub."\n";
$mes     .= 'ProposedBy: '.$ProposedBy."\n";
$mes     .= 'SecondedBY: '.$SecondedBy."\n";
$mes     .= 'Truthful: '.$truthful."\n";
$mes     .= 'date: '.$date."\n";

else
{
     mail($to, $sub, $mes, $headers);
     print "   <h3><center>Thank you ".$name." ".$name2." for contacting us.<br>We will get back to you as soon as possible</center></h3>";
}
?>

   <!-- your html -->

</body>
</html>
and the forms html is this (after corrections(thank you karinne))

HTML:
Code: Select all
<div id="form">
<h1 class="style8 style6 style6">Online Application Form <em>(not currently operating. Please check again later.) </em></h1>

<form action="send.php" method="post"  name="booking">
  <label><strong>Full Name</strong></label>
  <br />
  <input type="text" name="textfield" />
  </label>
  
  <p class="style6 style15"><strong>
    <label>Adress line 1</label><br />
    <input type="text" name="textfield2" />
     
     <label>Adress line 2</label>
     <input type="text" name="textfield3" />
  </strong></p>
  
  <p class="style6 style15"><strong>
  <label>Town/City</label><br />
    <input type="text" name="textfield4" />
  </strong></p>
  
  <p class="style6 style15"><strong>
    <label>County</label><br />
    <input type="text" name="textfield5" />

    <label>Postcode</label>
    <input type="text" name="textfield6" />
  </strong></p>

  <p class="style6 style15"><strong>
  <label>Telephone</label><br />
    <input type="text" name="textfield7" />
  </strong></p>
  
  <p class="style6 style15"><strong>
  <label>Mobile</label><br />
    <input type="text" name="textfield8" />
  </strong></p>
  
  <p class="style6 style15"><strong>
    <label>Email</label><br />
    <input type="text" name="textfield9" />
  </strong></p>

  <p class="style6 style15"><strong>
    <label>Date of Birth</label><br />
    <input type="text" name="textfield10" />    
  </strong></p>

  <p class="style6 style15"><strong>
    <label>Do you have a criminal record?</label><br />
    <select name="select">
      <option>Yes</option>
      <option>No</option>
    </select>
  </strong></p>

  <p class="style6 style15"><strong>
    <label>Are you having treatment for any of these?</label><br />
    <select name="select2">
      <option>Mental Depression</option>
      <option>Nervous Breakdown</option>
      <option>Melancholy</option>
      <option>Psychosis</option>
      <option>None of the above</option>
    </select>
  </strong></p>

  <p class="style6 style15"><strong>
    <label>Have you ever had a firearm Certificate refused/revoked?</label><br />
    <select name="select3">
      <option>Yes</option>
      <option>No</option>
    </select>
  </strong></p>

  <p class="style6 style15"><strong>
    <label>Have you ever had a shotgun Certificate refused/revoked?</label><br />
    <select name="select4">
      <option>Yes</option>
      <option>No</option>
    </select>
  </strong></p>

  <p class="style6 style15"><strong>Do you currently hold a firearm certificate, and if so, please fill in the details below:</strong></p>
  <strong>
  <label>AUTHORITY</label><br />
  <input type="text" name="textfield11" />
  <label>FAC Number</label>
  <input type="text" name="textfield12" /><br />
  </strong>
  <p class="style6 style15"><strong>Do you currently hold a shotgun certificate, and if so, please fill in the details below:</strong></p>
  <strong>
  <label>AUTHORITY</label><br />
  <input type="text" name="textfield13" />

  <label>FAC Number</label>
  <input type="text" name="textfield14" />
  </strong>
  <p class="style6 style15"><strong>
  <label>Please specify which firearms, if any, are currently in your possesion: </label><br />
  </strong></p>
  <p class="style6 style15"><strong>
    <textarea name="textfield15"></textarea>
  </strong></p>
  
  <p class="style6 style15"><strong>
    <label>Are you or have you been a member of any shooting club? If so which one?</label><br />
    <input type="text" name="textfield16" />
  </strong></p>

  <p class="style6 style15"><strong>
    <label>Proposed By:</label><br />
    <input type="text" name="textfield17" />   
  </strong></p>
  
  <p class="style6 style15"><strong>
    <label>Seconded By:</label><br />
    <input type="text" name="textfield18" />
  </strong></p>

  <p class="style6 style15"><strong>
    <label> By ticking the box below you confirm that all the details above have been filled in by you and are 100% truthful</label><br />
    <input type="checkbox" name="checkbox" value="checkbox" />
  </strong></p>

  <p class="style6 style15"><strong>
    <label>Current date:(dd/mm/yyyy)</label><br />
    <input type="text" name="textfield19" />
  </strong></p>

  <p class="style6 style15"><strong>Please send a cheque of &pound;25 for probationary membership to the Tidworth Rifle and Pistol Club , which is fully returnable on rejection of membership. Please enclose a passport-sized photo of yourself, which will be returned attached to your membership card, if membership is granted. </strong></p>
  
  <p class="style6 style15"><strong>Click below to submit form:  </strong></p>
  
  <p align="center"><strong>
    <input name="Submit" type="submit" onclick="return checkmail(applications@tidworthrpc.co.uk)" value="Submit" />
    <input name="Reset" type=reset value="Reset form" />
  </strong></p>
</form>


Any help much appreciated!!!
Reply With Quote
  #10 (permalink)  
Old Apr 17th, 2007, 16:14
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

You're missing this

PHP: Select all

//check all feilds filled in
if (empty($name) || empty($email) || empty($subject) || empty($msg))
{
     echo 
"   <h3>Sorry all fields are required.</h3>";
}
elseif(!
ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"$email)) {
     print 
"   <h3>Sorry the email address you entered looks like it's invalid.</h3>";
}
else
{
     
mail($to$sub$mes$headers);
     print 
"   <h3><center>Thank you ".$name." ".$name2." for contacting us.<br>We will get back to you as soon as posiable</center></h3>";
}
?> 
You only have the last else { ... } part.
Reply With Quote
  #11 (permalink)  
Old Apr 17th, 2007, 16:35
New Member
Join Date: Apr 2007
Location: a H0us3
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to paulka
Re: how to submit form

whoops sorry my bad hope you're sorted now

regards
paul
Reply With Quote
  #12 (permalink)  
Old Apr 17th, 2007, 16:52
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

still not working. when i submit im getting:

Thank you for contacting us


Warning: Division by zero in \\NAS35ENT\domains\t\mydomain.co.uk\user\htdocs\se nd.php on line 62
Sorry all fields are required.



and when i fill in the fields its the same but withou the sorry all fields required.

please help...
Reply With Quote
  #13 (permalink)  
Old Apr 17th, 2007, 17:00
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

Do you have those variables? $name, $email, $subject and $msg?
Reply With Quote
  #14 (permalink)  
Old Apr 17th, 2007, 17:09
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to submit form

i changed the variables to ones on my site.
Reply With Quote
Reply

Tags
email, form, submit

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form submit longstand PHP Forum 6 Nov 25th, 2007 01:14
submit many forms - auto submit the same form many times divs JavaScript Forum 0 May 24th, 2007 10:10
How to automate Form Submit??? TheGaffer8 Web Page Design 3 Apr 19th, 2007 11:08
Form Submit button Help!!! Aaron1988 Web Page Design 2 Nov 25th, 2006 13:51
Submit 1 form to 2 different URLs alstefani Classic ASP 1 Aug 31st, 2005 05:26


All times are GMT. The time now is 21:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved