Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

emailing from website


  • Please log in to reply

#1
jatangan

jatangan

    Member

  • Member
  • PipPip
  • 10 posts
I am new to webbuilding and i am using dreamweaver mx 2004 and i am having trouble with my contact page. I am building a simple page for a clinic and i need a contact page that emails the following information
fname,last name, add, insurance, DOB, height, weight, a calculator that calculates bodymassindex (BMI) based on height and weight, any other comments. i searched around and im completely dumbfounded on what to do~! i searched PHP and still not sure on what to do. I am not sure if the clinic has already purchased a server that has is a php server but anyway im lost can anyone please help.
  • 0

Advertisements


#2
ditto

ditto

    - i pwn n00bs -

  • Member
  • PipPipPipPip
  • 1,260 posts
Hey,

php is one way to do it or you can also use cgi.

To try cgi formmail, you will have to download the formmail script from matt's script archive.

http://www.scriptarc...=formmail&c=zip

extract the file then upload the formmail.pl to your site.....for example yoursite.com/cgi/formmail.pl

then you will have to enter some code onto a new website....

the following code will submit a users name,insurance, DOB, height and weight . copy and paste the following code into notepad.

<!--- start form mail code --->
<table cellpadding="0" cellspacing="0" border="0"
bgcolor="ffffff" width="100%">
<form method="POST" action="yoursite.com/cgi/formmail.pl">
<input type=hidden name="recipient" value="[email protected]">
<input type=hidden name="redirect" value="website to go after submit email">
<input type=hidden name="print_config" value="name,insurance,DOB,height,weight">
<input type=hidden name="print_blank_fields" value="1">
<tr>
<td width="20">&nbsp;</td>
<td width="75" align="right"
valign="top">Name:</td>
<td width="455" align="left">
<input type=text name="name" style="background:f9f9f9"
</td>
</tr>
<tr>
<td width="20">&nbsp;</td>
<td width="75" align="right" valign="top">Insurance:</td>
<td width="455" align="left"> <input type=text name="insurance"></td>
</tr>
<tr>
<td width="20">&nbsp;</td>
<td width="75" align="right" valign="top">DOB:</td>
<td width="455" align="left"> <input type=text name="DOB"></td>
</tr>
<tr>
<td width="20">&nbsp;</td>
<td width="75" align="right" valign="top">Height:</td>
<td width="455" align="left"> <input type=text name="height"></td>
</tr>
<tr>
<td width="20">&nbsp;</td>
<td width="75" align="right" valign="top">Weight:</td>
<td width="455" align="left"> <input type=text name="weight"></td>
</tr>
<tr>
<td width="20">&nbsp;</td>
<td width="75" align="right" valign="top"> </tr>
<tr>
<td width="20">&nbsp;</td>
<td width="50" align="right">&nbsp;</td>
<td width="480" align="left" colspan="2">
<input type="submit" value="submit"></td>
</tr>
</form>
</table>
<!--- end form mail code --->


change the bold letters to adhere to your site or email address.
sorry if it looks mumbo jumbo but after you are finished, save the file as "contact.html" or whatever you desire, then upload it to your site.

you can find a good php formmail here:
http://www.kirupa.co...ontact_form.htm


gl and let me know if you have any questions,

ditto

Edited by ditto, 20 November 2005 - 08:56 PM.

  • 0

#3
jatangan

jatangan

    Member

  • Topic Starter
  • Member
  • PipPip
  • 10 posts
I checked that site, i dont know how to test it this is my code will it work?

html(contacts.html)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>New Reflections - Contact Us</title>
</head>

<body>
<div id="body" style="position:absolute; left:2px; top:1px; width:640; height:985px; z-index:1; background: url(bg.jpg); layer-background-image: url(bg.jpg); border: 1px none #000000;">
<form name="form1" method="post" action="mailer.php">
<p>First Name
<input name="fname" type="text" id="fname" size="20">
Last Name
<input name="lname" type="text" id="lname">
<br>
Email Address
<input name="email" type="text" id="email">
<br>
Age
<input name="age" type="text" size="5">
Date of Birth
<input name="month" type="text" size="5" maxlength="2">
/
<input name="day" type="text" size="5" maxlength="2">
/
<input name="year" type="text" size="5" maxlength="4">
<br>
Insurance:
<input name="insurance" type="text" size="50" maxlength="50 ">
<br>
<label>
<input type="radio" name="referrral" value="radio">
HMO</label>
<label>
<input type="radio" name="referrral" value="radio">
PPO</label>
<br>
<br>
Height:
<input name="height_feet" type="text" size="3" maxlength="2">
feet,
<input name="height_inches" type="text" size="3" maxlength="2">
inches<br>
BMI
<input name="bmi" type="text" size="5" maxlength="2">
</p>
<p>Where did you hear about New Reflections?<br>
<select name="referral">
<option>Surfing the Web</option>
<option>Saw the commercial</option>
<option>Newspaper/ Magazine Article</option>
<option>Someone Referred me</option>
<option>Other</option>
</select>
</p>
<p>Message to New Reflections<br>
<textarea name="message" cols="50"></textarea>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>

</div>
</body>
</html>


And heres the mailer.php file


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<?php
if(isset($_POST['submit'])) {
$to = "[email protected]";
$subject = "NR Website Referral";
$fname_field = $_POST['fname'];
$age_field = $_POST['age'];
$day_field = $_POST['day'];
$month_field = $_POST['month'];
$year_field = $_POST['year'];
$insurance_field = $_POST['insurance'];
$type_field = $_POST['radio'];
$feet_field = $_POST['feet'];
$inches_field = $_POST['inches'];
$BMI_field = $_POST['BMI'];
$referral_field = $_POST['referral'];
$lname_field = $_POST['lname'];
$email_field = $_POST['email'];
$message = $_POST['message'];

$body = "From: \n First: $fname_field\n Last: lname_field\n E-Mail: $email_field\n Age: $age \n
DOB: $monthfield \ $day_field \ $year_field \n Insurance: $insurance_field \n Type: $type_field \n
Height: $feet_field , $inches_field \n BMI: $BMI_field \n Referral : $referral_field \n Message:\n $message"; 0

echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "Error : Data was not sent. Please fill EVERYTHING out again!";
}
?>

</body>
</html>


  • 0

#4
Paradox924X

Paradox924X

    Member

  • Member
  • PipPipPip
  • 208 posts
The PHP bit will work..
  • 0

#5
Allsortgroup

Allsortgroup

    I SPAMMED Too Much!

  • Banned
  • PipPipPip
  • 905 posts
Php forms are really easy!

You just link your form to go to the php file, and the php file will process it for you!

But, you may need someone here to help you make a php file if you don't know php well.

:tazz:
  • 0

#6
Paradox924X

Paradox924X

    Member

  • Member
  • PipPipPip
  • 208 posts
They could just look at www.hotscripts.com
Thats an awesome website and you don't have to do anything except copy and paste their code!
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP