ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Web Form design query



Hey people,

I am trying to create a simple web form that has a couple of text fields and a Submit button. When I click submit, it tried to fire up the default mail program (Outlook in this case). Is there any way I can just have someone click Submit and that be it?

Thanks,
TS
 
  DCi
if your server doesn't support PHP or anything like that you could try something like this:

Code:
<a href="mailto=an@email.com?subject=subject&body=Template goes here">Click here</a>
 
PHP:
<p>Email From:* <br>
<input type="text" name="EmailFrom">
<p>Subject: <br>
<input type="text" name="Subject">
<p>Name:* <br>
<input type="text" name="Name">
<p>Address:<br>
<input type="text" name="Address">
<p>Telephone:<br>
<input type="text" name="Telephone">
<p><input type="submit" name="submit" value="Submit">
</form>
<p>

PHP:
<?php
$EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); 
$EmailTo = "youremailhere";
$Subject = Trim(stripslashes($_POST['Subject'])); 
$Name = Trim(stripslashes($_POST['Name'])); 
$Address = Trim(stripslashes($_POST['Address'])); 
$Telephone = Trim(stripslashes($_POST['Telephone'])); 

$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (Trim($Name)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Telephone: ";
$Body .= $Telephone;
$Body .= "\n";

$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
 
  GW RS200
..or most hosts have a CGI script that can be used to send a form.

He speaks the truth - ask your host provider if they have a CGI script for it, or read their FAQ regarding one. It's usually dead simple to implement - you just dump the script in a folder next to your website and call it in the form rather than a mailto: command.
 


Top