• Starting today August 7th, 2024, in order to post in the Married Couples, Courting Couples, or Singles forums, you will not be allowed to post if you have your Marital status designated as private. Announcements will be made in the respective forums as well but please note that if yours is currently listed as Private, you will need to submit a ticket in the Support Area to have yours changed.

  • CF has always been a site that welcomes people from different backgrounds and beliefs to participate in discussion and even debate. That is the nature of its ministry. In view of recent events emotions are running very high. We need to remind people of some basic principles in debating on this site. We need to be civil when we express differences in opinion. No personal attacks. Avoid you, your statements. Don't characterize an entire political party with comparisons to Fascism or Communism or other extreme movements that committed atrocities. CF is not the place for broad brush or blanket statements about groups and political parties. Put the broad brushes and blankets away when you come to CF, better yet, put them in the incinerator. Debate had no place for them. We need to remember that people that commit acts of violence represent themselves or a small extreme faction.

Need your Help

d0c markus

The harvest is plentiful, but the laborers are few
Oct 30, 2003
2,474
77
42
✟3,060.00
Faith
Baptist
Marital Status
Single
I am building a form for my website. My goal is to keep the website simple.

Basically when i hit the submit button, my form opens up my default email program, and thats bad, i dont want that to happen. My research tells me that the normal HTML code does something different with IE 6.

Here is my code, perhaps you can change what needs to be changed in the code for me, or at least point me to a fix.

Code:
  <FORM METHOD="POST" ACTION="[email="staff@keptbyfaith.com"]mailto:staff@keptbyfaith.com[/email]">
<p>NAME:   <INPUT TYPE="TEXT" NAME="NAME:" SIZE="30"><BR>
EMAIL: <INPUT TYPE="TEXT" NAME="EMAIL:" SIZE="30"><BR>
Article responding to?<INPUT TYPE="TEXT" NAME="ARTICLE:" SIZE="75"><br>
<SELECT NAME="Type_of_Comment:" Size="1"
<option selected>
<option>Type of Comment?
<option>General Comment
<option>Question
<option>Complaint
</select><br>
<TEXTAREA NAME-"Comment" ROWS="12" COLS="80"></textarea><BR>
<INPUT TYPE="submit" value="Submit Comment"><br>
<INPUT TYPE="RESET"> </p>
</form>
 

trunks2k

Contributor
Jan 26, 2004
11,369
3,520
42
✟277,741.00
Faith
Humanist
Marital Status
Married
Politics
US-Others
Your code is doing what is supposed to do, which is open an e-mail message with the default e-mail program to staff@keptbyfaith.com. That's what mailto: does. If you want it to automatically send an e-mail out, with a automatically made message, you'll have to play around something like PHP. JavaScript might be able to do it, but I am not familiar with how to.
 
Upvote 0

d0c markus

The harvest is plentiful, but the laborers are few
Oct 30, 2003
2,474
77
42
✟3,060.00
Faith
Baptist
Marital Status
Single
jono1 said:
what do you want the form to do?? if you want it to just email the results to you, go to www.hotscripts.com and search up a php script called formmail, it should come with all the necessary instructions.
i came, i saw, i'm dumbfounded... :help: :blush: i'm the guy who got a D in shop class in highschool, i figure programming cant be much different than making a simple wodden candy dispenser... which means its not gonna work if i Do it.

http://www.christianforums.com/t701526
 
Upvote 0

firecracker

Active Member
Jun 12, 2004
249
11
✟449.00
Faith
Christian
Yes, Mailto: has one crude function...to open the default e-mail program on the clients PC, which is less than ideal when the client is using a shared machine, such as in a library.

You need a PHP script to work with the HTML Form you already have, its easy enough. I'll put a simple PHP script on here tomorrow (Wednesday) for you to use... but you will have be able to use PHP on your host!
 
Upvote 0

firecracker

Active Member
Jun 12, 2004
249
11
✟449.00
Faith
Christian
1. To test you even have a good php service on your server, make this small text file up and save it on your server as phpinfo.php...

<? phpinfo(); ?>

...really, thats all it needs. Now call it from your browser... www.yourhost.com/phpinfo.php for example.

Everything is ok if you then get a long page load of variables and settings. If not then find out why php isn't on your site and / or configured correctly.


2. Heres a sample HTML form... name it anything you want, and put it on your server.

<html>
<head>
<title></title>
</head>
<body>
<div align="center">
<table>
<form action="formail.php" method="post" enctype="application/x-www-form-urlencoded">
<tr>
<td valign="top" align="left">Name</td>
<td valign="top" align="left">
<input type="text" size="36" id="formname" name="uname"></td>
</tr>
<tr>
<td valign="top" align="left">Email&nbsp;</td>
<td valign="top" align="left">
<input type="text" size="36" id="formemail" name="uemail"></td>
</tr>
<tr>
<td valign="top" align="left">Message</td>
<td valign="top" align="left">
<textarea rows="8" cols="30" id="formmessage" name="umessage"></textarea><br>
</td>
</tr>
<tr>
<td valign="top" align="left">&nbsp;</td>
<td valign="top" align="left"><input type="submit" value="send"><input type="reset" value="clear"></td>
</tr>
</form>
</table>
</div>
</body>
</html>


3. Heres the associated PHP script... name it formail.php and save it on your server.

<?php
$uname="$_REQUEST['uname']" ;
$uemail="$_REQUEST['uemail']" ;
$umessage="$_REQUEST['umessage']" ;
$message ;
$error ;?>

<html>
<head>
<title></title>
</head>
<body>
<center>
<p><br>
<br>
<br>
<?php

if ($uname) // Check for Name input
{ $user="Name - $uname" ; // Create a line for the email message $message .="$user\n" ; // Add it to the message }
else
{ $error ="You did not enter your name&lt;br&gt;\n" ;// Error if no Name input }

if ($uemail) //Check for email address
{ $umail ="Email - $uemail" ; // Create a line for the email message $message .="$umail\n" ; // Add it to the message }
else
{ $error .="You did not enter your e-mail address&lt;br&gt;\n" ; // Add to Error if missing }

if ($umessage) //Check for a valid message
{ $umail ="Message - $umessage" ; // Create a line for the email message $message .="$umessage\n" ; // Add it to the message }
else
{ $error .="You did not enter a message&lt;br&gt;\n" ; // Add to Error if missing }

if ($error == "" ) // If Error contains nothing, display a message
{ // and send the email
echo "Thank you for using the on-line form." ;
mail("yourname@yourcompany.com", "Message from Web Site" , $message);
}

else // If Error does contain something, display a message and tell the user what's wrong.

{
print "The form cannot be sent until all the fields are completed!";
}

?>

</p>
</center>
</body>
</html>


4. Finally, in the script above enter your real email address, and give it a go. All things being well your form has been sent to the email address you specified. If you get a 'could not connect to mail server' error then contact your hoster to make sure the email is setup correctly.
 
Upvote 0