Jump to content

ghost

Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by ghost

  1. Hi,Lots of people seem to have told you about writing scripts in PHP or ColdFusion or whatever, and as a PHP guy I fully support that you might want to take the next step and learn one of these tools.However, I think most people have forgottten that there is a plain-old HTML down and dirty method to do what you want.That is, allow a visitor to your site communicate with you without needing to have an email window 'pop-up' for that communication (it is a pain for the user, and often just doesn't work on public computers).You simply create your form in HTML as you already know how to do. (Usually, you would make your form approximate the look of an email composition window.) Then you make the action attribute of your form tag to be "mailto:myeamil@mydomain.com". Before I learned more than HTML I had many forms that would post this way, and then I created a simple parsing routine in a desktop rdbms. It works, not as elegantly as PHP, but it worked very well for a number of years as my workload prevented my HTML/PHP learning curve from being steeper.You also get the added advantage that you can put in a lot more attributes that you may want to collect with radio buttons, checkboxes and so on  (often a comment will force the users to select a 'topic' from a finite list, and supply some basic demographics (gender; age range; income range). It comes to you in a somewhat ugly format, but it is also a logical format ("name=value" pairs, or is it "name:value" pairs, or?...).(caveat: I haven't done if for a while, so you might have to play with the syntax, but it is pretty close.)

    I didn't want to send the file via Outlook, however. When I do that to the form action, Outlook opens to send the message. The whole point of the email form was to send it via HTML and not via Outlook. Am I missing something with your post?
  2. Hi ghost,The model you layout is ONE way to do it.  Its what I prefer to do, (a form page and an action page) because it keeps things contained.  And as you build bigger applications, you will need to keep things contained as they are far more manageable.But, understand that Chocolate570's solutions is a combination of the form and action in one page.  This is very common for things like this - its called a postback - a page posting to itself.  There is always more than one way to skin a cat when it comes to web development - so its tough when your looking for a solution down one road and you miss the one on the site street.:)So, look at Chocolate570s solution as an HTML page with the mail action hidden inside.  It is hidden until the page is "posted to" - that triggers the PHP code to execute and not sit dormant.  Personally, I'd like to see his code check the referring page to make sure it is posting to itself and not from anywhere else - otherwise I would be worried and email spiders piggy backing my mail server. :( Hope this helps you get a little more focused on your solution and not your problem :)

    Ok, I have gotten my form to process via a .php file. However, when the message is sent to the designated email address, none of the user inputs appear in the message. That was part of the goal here, i.e. to allow a user to input information and then have it sent from a form to a designated email address. Here is my code for both the .html file and the .php file. Can someone tell me what is wrong?HTML
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Joe and Joan - Contact Us</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><!-- Links to other pages --><body text="#000000" link="#000000" vlink="#0066FF"><p align="center"><a href="ContactUstest.html">Contact Us</a> :: <ahref="Accommodations.htm">Accommodations</a>:: <a href="Engagementtest.htm">Engagement</a> :: <a href="Weddingtest.htm">Wedding</a>:: <a href="Registrytest.htm">Registry</a> :: <a href="Married%20Gueststest.htm">MarriedGuests</a> :: <a href="Golf%20Tournamenttest.htm">Golf Tournament</a> :: <ahref="AustinTXtest.htm">Austin,TX</a></p><!-- Now let's interact with the user and get some information --><!-- Set how this form is handled --><form action="confirm.php" method="post" enctype="text/plain"><h3>This form sends an e-mail to Joe and Joan</h3><!-- Get inputs from user and remember to verify data types in confirm.php -->Your Name:<br><input name="name" value="" size="20" type="text"> <br>Email Address:<br><input name="mail" value="" size="20" type="text"> <br>Subject:<br><input name="subject" value="" size="20" type="text"> <br>Message: <br><textarea rows="12" name="message" cols="60"></textarea>   <br>  <br>    <!-- Create the UI control to send message -->    <input value="Send Message" type="submit">    <input value="Reset" type="reset">  </p></form><p><script type="text/javascript">function tS(){ x=new Date(); x.setTime(x.getTime()); return x; }function lZ(x){ return (x>9)?x:'0'+x; }function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; }function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) }function dT(){ window.status=''+eval(oT)+''; document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); }function aP(x){ return (x>11)?'pm':'am'; }var dN=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'),mN=new Array('January','February','March','April','May','June','July','August','September','October','November','December'),oT="dN[tS().getDay()]+''+','+' '+mN[tS().getMonth()]+' '+(tS().getDate())+''+','+' 20'+y2(tS().getYear())+' '+'-'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())";if(!document.all){ window.onload=dT; }else{ dT(); }</script></p></body></html>

    PHP

    <?php //use simple algorithm to get user info. there is no input validation or //success var for email transfer. //get Name, email, subject, and message from form and set process vars $visitor_name = $_POST['name']; $visitor_email = $_POST['mail']; $visitor_subject = $_POST['subject']; $visitor_message = $_POST['message']; //set your email parameters $to_address = 'info@joeandjoan.net'; $subject = 'Information from your website contact form'; $mail_content = 'Visitor Name: '.$visitor_name."\n" .'Visitor Email Address: '.$visitor_email."\n" .'Email Subject: '.$visitor_subject."\n" .'Visitor Message: '.$visitor_message."\n"; $from_address ='www.joeandjoan.net'; //now send it! mail($to_address, $subject, $mail_content, $from_address); //tell user information was successfully processed echo '<p>Your message was sent successfully to Joe and Joan at '; echo date('H:i a, F jS, Y'); echo '</p>'; //that's it ?>

  3. That's some good info. I can create a one button drop down menu in Fireworks from this link (http://www.entheosweb.com/website_design/drop_down_menus.asp), but then can't figure out how to put those individual buttons I create into on nav bar. I like the way Fireworks set's it up. I might try and utilitze your example if I can't figure out the Fireworks and Dreamweaver method. Thanks for everyone's help.
  4. That is what I am looking for except, I want the main menu to be horizontal and then have the actual drop down portion vertical underneat the main menu. This link shows how to do it and I can accomplish it. However, I don't know how to turn each menu item I create into a navigation bar. When I try to create the nav bar in dreamweaver, the preview doesn't show the drop down menu.
  5. How do I build a drop down menu that goes horizontally? I have seen examples with the menu vertical on either side of the page, but not any examples for horizontal drop down menus. Can anyone help or point me to an example? Thanks so much.

  6. well this is the code i use for the year and it puts 2005
    var d = new Date()document.write(d.getYear())

    and this is the code i use for the day, date, month, year, time.

    <script type="text/javascript">var d=new Date()var weekday=new Array(7)weekday[0]="Sunday,"weekday[1]="Monday,"weekday[2]="Tuesday,"weekday[3]="Wednesday,"weekday[4]="Thursday,"weekday[5]="Friday,"weekday[6]="Saturday,"document.write("Today it is " + weekday[d.getDay()])document.write(" ")var b=new Date()var month=new Array(12)month[0]="January"month[1]="February"month[2]="March"month[3]="April"month[4]="May"month[5]="June"month[6]="July"month[7]="August"month[8]="September"month[9]="October"month[10]="November"month[11]="December"document.write("" + month[b.getMonth()])document.write(" ")var c = new Date()document.write(c.getDate())document.write ("<b>, </b>")var d = new Date()document.write(d.getYear())document.write(" the time is ")var e = new Date()document.write(e.getHours())var f = new Date()document.write ("<b>:</b>")document.write(f.getMinutes())</script>

    hope this helps

    I am trying to keep the code I have, but just modify it. Surely it can be modified other than how I have it. However, it's not like I wll be around to see 2100, so maybe I ought to leave well enough alone.
  7. I am trying to do a time and date script as well. I have figured everything out except for how to get the year to be "2005" rather than "05" for example. The only think that I could find to make it work is to physically type in "20" before the code in the script that calls the year. I know there must be a way to do it so the script gets it automatically, but I can't figure it out. Can anyone help me? Here is the java script:

    <script type="text/javascript">function tS(){ x=new Date(); x.setTime(x.getTime()); return x; }function lZ(x){ return (x>9)?x:'0'+x; }function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; }function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) }function dT(){ window.status=''+eval(oT)+''; document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); }function aP(x){ return (x>11)?'pm':'am'; }var dN=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'),mN=new Array('January','February','March','April','May','June','July','August','September','October','November','December'),oT="dN[tS().getDay()]+''+','+' '+mN[tS().getMonth()]+' '+(tS().getDate())+''+','+' 20'+y2(tS().getYear())+' '+'-'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())";if(!document.all){ window.onload=dT; }else{ dT(); }</script></p>

  8. Ghost, change the extention of the html page to a .php, and it will work as if it were .html. Try it.

    But the code you wrote was to be used as .php, right? So how can that work with the form I have? You know what...I think I need to just start over. I am getting confused here.This info is what I know. Correct me if I am wrong. To do what I am asking, i.e. sending email via a form in a webpage you need:1) a page with the form coded in html2) a page performing the action of the form, coded in .php or .asp or whateverDon't the two pages have the same code with the exception of the additional .asp or .php code?
  9. Ok, this is the code. Save this file as a .php and then it should work. One thing..... where you see joeblow@hotmail.com, make sure you set it to the correct email address to send it to.If  I get time, i'll add the extras you had put in your form. But for now, you can fool around with this:
    <?php if (!isset($_POST["send"])){   // no post data -> display form   ?>   <form method="POST" action="<?=$_SERVER['PHP_SELF'];?>"><center><table width="50%"><tr><td><fieldset><legend><font color="white">Contact Us</font></legend><table width="100%" align="center">   <tr><td><font color="white">Your Email:</font> <input type="text" name="sender"></td></tr>   <tr><td><font color="white">Subject:</font></td><td> <input type="text" name="subject"></td></tr>   <tr><td><font color="white">Message:</font> <br />	<textarea name="message" rows="10" cols="60" lines="20"></textarea></td></tr>   <tr><td align="left"><input type="submit" name="send" value="Send"></td></tr></table></fieldset></tr></td></table></center>   </form>   <?  }else{   // found post data .. deal with it   // set email to send email to $to[0]="JoeBlow@hotmail.com";   $from=$_POST['sender'];   // send mail :   if ((mail($to[1],"Scaped: ".$_POST['subject'],$_POST['message']."\n\nSent from ".$_SERVER['REMOTE_ADDR'],"From: $from\n"))&&(mail($to[0],"Scaped: ".$_POST['subject'],$_POST['message']."\n\nSent from ".$_SERVER['REMOTE_ADDR'],"From: $from\n"))){     // display confirmation message if mail sent successfully     echo "Your email was sent."; }else{   // sending failed, display error message    echo "We are sorry, your email could not be sent. Try again later.";   } } ?>

    But don't I have to have an .html page with the form in it first or is this page include everything? I think we had this discussion before, but I wanted to verify.
  10. Ok, I still haven't figured this form/mail thing out. Here are my codes for the form and then for the .PHP. Can someone tell me what is wrong?Form Code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">  <title>Joe and Blow - Contact Us</title></head><body style="color: rgb(0, 153, 0); background-color: rgb(51, 204, 255);" leftmargin="5" topmargin="0" alink="#000099" link="#009900" marginheight="0" marginwidth="5" vlink="#990099"><form action="confirm.php" method="post" enctype="text/plain">  <h3>This form sends an e-mail to Joe and Blow</h3>Your Name:<br>  <input name="name" value="" size="20" type="text"> <br>Email Address:<br>  <input name="mail" value="" size="20" type="text"> <br>Subject:<br>  <input name="subject" value="" size="20" type="text"> <br>Message: <br>  <textarea rows="12" name="message" cols="60"></textarea>   <br>  <br>  <input value="Send Message" type="submit"> <input value="Reset" type="reset"></form><form method="post" action="joeblow@gmail.com" id="form1" name="form1"> <a href="HomePage.html#Home">Home</a>  <br>  <a href="form.html#form">Enquiry Form</a>   <br>  <br>  <p><span id="tP"> </span>  <script type="text/javascript">function tS(){ x=new Date(); x.setTime(x.getTime()); return x; }function lZ(x){ return (x>9)?x:'0'+x; }function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; }function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) }function dT(){ window.status=''+eval(oT)+''; document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); }function aP(x){ return (x>11)?'pm':'am'; }var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),oT="dN[tS().getDay()]+' '+(tS().getDate())+' '+mN[tS().getMonth()]+' '+y2(tS().getYear())+' '+'-'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())";if(!document.all){ window.onload=dT; }else{ dT(); }  </script></p></form></body></html>

    .PHP Code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">  <title>Joe and Blow - Confirm</title></head><body><?php <BODY BGCOLOR="#FFFFFF"><%if ((!$realname ) or (!$telephone) && (!$email)) {echo "Please Enter a Contact Name and either a Telephone Number or an Email address for Contact purpose's.Thank You";echo "<p>";echo "Please use the 'Back' button to continue.";echo "</p>";echo "<a href='/form.html' onclick='self.history.back();'>Back</a>";exit;} $message="Name: $realname\n\n"."Organisation: $organisation\n\n"."Address:\n$address_line_1\n\n"."Post Code: $postcode\n\n"."Telephone: $telephone\n\n"."Fax: $fax\n\n"."Email: $email\n\n"."Message: \n".$text;mail("joeblow@gmail.com","$subject","$message","From:Form.$email\r\nReply-to:$email");echo "<p>Thank you for completing our contact form. Your details have been forwarded and we will be in contact within 2 working days.</p>";echo "<p>From: $email</P>";echo "<p>Subject: $subject</p>";echo "<p>Message: </p>";echo "<p>";echo $text;echo "</p><a href='/HomePage#Home.html'><b>Return to the Home Page</b></a>";%></BODY></HTML>?><br></body></html>

  11. I figured it out, here it is in case anyone else wants to know.  Instead of making a html form that posts to an .ASP file, just combine the two in one like so.  Also there is no need to separately upload the files before attaching them to the message, this code does it all at once, to see the finished product go to http://www.selfcenteredproductions.com/resume.asp  :)-=j0nnyr0773n=- :)

    I am new at all these server scripting languages, so bear with me. I am trying to do the same thing with a form, i.e. send comments and conctact info to me via an email form on my website.With .ASP, do you have to create the form page and then also create the "action" page. I am trying to follow your code from that link you provided. However, I didn't see the code you show in this post. Is that the code that you have for when a person submitts his or her info to your site and it's just uploaded to your host service?I still haven't been able to figure out how to send the info I request of the user (from the form) to my email via the form in HTML. I have code for the form, but I guess the trouble I am having is with the "action" code.
  12. I will post it when I get home this evening.  Thanks for the help.  Do you recommend any books for learning web design?  If this question is hijacking the thread, then let me know and I will erase it.  You can PM me the answer, if you have one.

    Here is my code for the nav bar:
    <script language="JavaScript" type="text/JavaScript"><!--function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}function MM_nbGroup(event, grpName) { //v6.0  var i,img,nbArr,args=MM_nbGroup.arguments;  if (event == "init" && args.length > 2) {    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();      nbArr[nbArr.length] = img;      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {        if (!img.MM_up) img.MM_up = img.src;        img.src = img.MM_dn = args[i+1];        nbArr[nbArr.length] = img;    } }  } else if (event == "over") {    document.MM_nbOver = nbArr = new Array();    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {      if (!img.MM_up) img.MM_up = img.src;      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);      nbArr[nbArr.length] = img;    }  } else if (event == "out" ) {    for (i=0; i < document.MM_nbOver.length; i++) {      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }  } else if (event == "down") {    nbArr = document[grpName];    if (nbArr)      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }    document[grpName] = nbArr = new Array();    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {      if (!img.MM_up) img.MM_up = img.src;      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;      nbArr[nbArr.length] = img;  } }}//--></script><body bgcolor="#0000CC" link="#990066" vlink="#0066FF" onLoad="MM_preloadImages('Pictures/hometestdown.png','Pictures/hometestover.png','Pictures/engagementtestdown.png','Pictures/engagementtestover.png','Pictures/weddingtestdown.png','Pictures/weddingtestover.png','Pictures/marriedguestsdown.png','Pictures/marriedguestsover.png','Pictures/golftournamentdown.png','Pictures/golftournamentover.png','Pictures/contactusdown.png','Pictures/contactusover.png')"><table border="0" cellpadding="0" cellspacing="0">  <tr>     <td><a href="Home.htm" target="_top" onClick="MM_nbGroup('down','group1','Home','Pictures/hometestdown.png',1)" onMouseOver="MM_nbGroup('over','Home','Pictures/hometestover.png','',1)" onMouseOut="MM_nbGroup('out')"><img src="Pictures/hometestup.png" alt="Home" name="Home" width="115" height="25" vspace="5" border="5" onload=""></a></td>  </tr>  <tr>     <td><a href="Home.htm" target="_top" onClick="MM_nbGroup('down','group1','Engagement','Pictures/engagementtestdown.png',1)" onMouseOver="MM_nbGroup('over','Engagement','Pictures/engagementtestover.png','',1)" onMouseOut="MM_nbGroup('out')"><img src="Pictures/engagementtestup.png" alt="Engagement" name="Engagement" vspace="5" border="5" onload=""></a></td>  </tr>  <tr>     <td><a href="Home.htm" target="_top" onClick="MM_nbGroup('down','group1','Wedding','Pictures/weddingtestdown.png',1)" onMouseOver="MM_nbGroup('over','Wedding','Pictures/weddingtestover.png','',1)" onMouseOut="MM_nbGroup('out')"><img src="Pictures/weddingtestup.png" alt="Wedding" name="Wedding" vspace="5" border="5" onLoad=""></a></td>  </tr>  <tr>    <td><a href="Home.htm" target="_top" onClick="MM_nbGroup('down','group1','MarriedGuests','Pictures/marriedguestsdown.png',1)" onMouseOver="MM_nbGroup('over','MarriedGuests','Pictures/marriedguestsover.png','',1)" onMouseOut="MM_nbGroup('out')"><img src="Pictures/marriedguestsup.png" alt="Married Guests" name="MarriedGuests" vspace="5" border="5" onLoad=""></a></td>  </tr>  <tr>    <td><a href="Home.htm" target="_top" onClick="MM_nbGroup('down','group1','GolfTournament','Pictures/golftournamentdown.png',1)" onMouseOver="MM_nbGroup('over','GolfTournament','Pictures/golftournamentover.png','',1)" onMouseOut="MM_nbGroup('out')"><img src="Pictures/golftournamentup.png" alt="Golf Tournament" name="GolfTournament" vspace="5" border="5" onLoad=""></a></td>  </tr>  <tr>    <td><a href="Home.htm" target="_top" onClick="MM_nbGroup('down','group1','ContactUs','Pictures/contactusdown.png',1)" onMouseOver="MM_nbGroup('over','ContactUs','Pictures/contactusover.png','',1)" onMouseOut="MM_nbGroup('out')"><img src="Pictures/contactusup.png" alt="Contact Us" name="ContactUs" vspace="5" border="5" onLoad=""></a></td>  </tr></table>

  13. oh...can you post your navigation code and I will show you how to make a pull down menu for it.

    I will post it when I get home this evening. Thanks for the help. Do you recommend any books for learning web design? If this question is hijacking the thread, then let me know and I will erase it. You can PM me the answer, if you have one.
  14. yes you can...have you looked at the example shown above? Do you understand what is being done? If not post what code you have and I can walk you through it.Also could a Moderator move this portion of the post...it isn't nice to hijack other ppls posts.Thanks.

    How am I hijacking the post? Am I not talking about the same thing, just a different function? I apologize if I am hijacking the post.I can't post my code until I get home. My code is on my home computer. I vaguely understand the code in the example. It looks like a table was used for the naviagation bar. Other than that, I don't follow the java scripting part of the code.
  15. Let me try and be more specific. I created a vertical navigation bar. For one of the buttons (there might be more that I want to do this function), I would like to have another menu "pull out" when the mouse pointer is over it. Another vertical navigation bar that would come out parallel to the main navigation bar. Maybe that will help what I am asking.Another question. How do I keep this navigation bar on every page? Is that what is done with CSS or a templates? Obviously, the point for asking is because I don't want to have to ad the code to each page I create. Sorry, I am a beginner and don't know a whole lot. I am learing as I go.

  16. If I have already created a navigation bar, can I still ad this functionality. I am talking about having another menu appear when you go over one link/button on the navigation bar. I used Dreamweaver to creat the navigation bar and Fireworks to creat the Up, Down, and Over states of the nav bar buttons.

  17. I'm sorry, I definitely don't intend to drive you down a twisty dark road with no headlights . . . :) Before we go into the session variable setting, is there anything prior to that that should be clarified?

    Not a problem. Our levels of knowledge are on two different elevations. Ok, I understand what you initially said about creating a form page and then an action page. I have already coded a form.html page. My problems are coming on trying to code an action page with ".php" I guess it's just a matter of me figuring out how the ".php" code on the action page works and what I need to modify to make it work for my already existing form.Here is my code for the form:Note - I have changed the email address to an example, rather than include mine and I also have a time and date script at the bottom.
    <html><head>  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">  <title>Joe and Blow - Contact Us</title></head><body style="color: rgb(0, 153, 0); background-color: rgb(51, 204, 255);" leftmargin="5" topmargin="0" alink="#000099" link="#009900" marginheight="0" marginwidth="5" vlink="#990099"><form action="MAILTO:joeblow@yahoo.com" method="post" enctype="text/plain">  <h3>This form sends an e-mail to Joe and Blow</h3>Your Name:<br>  <input name="name" value="" size="20" type="text"> <br>Email Address:<br>  <input name="mail" value="" size="20" type="text"> <br>Subject:<br>  <input name="subject" value="" size="20" type="text"> <br>Message: <br>  <textarea rows="12" name="message" cols="60"></textarea>   <br>  <br>  <input value="Send Message" type="submit"> <input value="Reset" type="reset"></form><form method="post" action="joeblow@yahoo.com" id="form1" name="form1"> <a href="HomePage.html#Home">Home</a>  <br>  <br>  <p><span id="tP"> </span>  <script type="text/javascript">function tS(){ x=new Date(); x.setTime(x.getTime()); return x; }function lZ(x){ return (x>9)?x:'0'+x; }function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12:x; }function y2(x){ x=(x<500)?x+1900:x; return String(x).substring(2,4) }function dT(){ window.status=''+eval(oT)+''; document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); }function aP(x){ return (x>11)?'pm':'am'; }var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),oT="dN[tS().getDay()]+' '+(tS().getDate())+' '+mN[tS().getMonth()]+' '+y2(tS().getYear())+' '+'-'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '+aP(tS().getHours())";if(!document.all){ window.onload=dT; }else{ dT(); }  </script></p></form></body></html>

    edit: wrapped code to clean page up - skemcin

  18. A session is basically related to the time period in which a unique user is visiting your site.  A sessoin variable is kind of like a server side cookie.  They allow you to set the value of something once and then use it over and over again without having to set it again - at least until the session times out or the user leaves the site.Session variables are not available in HTML, CSS, or Javascript - they are defined by a scripting language, like asp, php, or cold fusion.  Things that are commonly stored as a session variable would include the name of the database, a default e-mail address, a persons full name, or what classification user they are - things that get reused over and over again that would be a waste to define everytime a page is hit.

    How would I set my destination email address to a session variable? When things are becoming vaguely clear on one topic, you switch to another one and I get totally lost...lol. I appreciate all your help, regardless.
  19. Thats what I describe, a page for teh form, a page to process the form, and a third to say thanks.  Now, many people prefer to make the first page conditional - so if you haven't processed the form, its shows you the form where if you did process the form it would show thanks.I won't go into the differences between asp, php, and cold fusion - that begin to be like talking about politics - everyone has their preference.  All in all, asp is popular because microsoft added it to their web server - which is popular due to their "success".  PHP is popular because its free and its not microsoft.  Cold Fusion is the least popular (unfortunately) mainly becuase the server used to cost a lot and was less accessible the the others.  But thats where the conversation on that needs to end in this post - someone can troll that in another topic.But back to the first part of your reply.  Here is an example:contactme.cfm
    <div class="content"><cfif session.contactme IS "thanks"><strong class="pagetitle">Thanks :.</strong><br /><cfset session.contactme = "backagain"><cfoutput>I appreciate you taking the time to contact me. I will do my best to get in touch with you as soon as possible.  If I do not get back to you with in 48 hours, please feel free to leave a message on my cell phone by calling #session.cellphone#.<br /><br />Talk to you soon<br /><br /></cfoutput><cfelseif session.contactme IS "backagain"><strong class="pagetitle">Hi Again :.</strong><br />You have already sent a message.  If would like to send another message, please come back in an hour when your site session has expired.  I apologize for the inconvenience, but this helps me keep the spammers from manipulating my website.<br /><br />Thanks again<br /><br /><cfelse><strong class="pagetitle">Contact Me :.</strong><br />Please fill out the form below and include any details about your question or comment in the message area.  I appreciate your time and I will do my best to reply to you as soon as possible.<br /><br /><cfform action="contactme-action.cfm" method="post"><strong class="smallestfont">FULL NAME:</strong><br /><cfinput type="text" name="ctm_fullname" value="" style="width:250px;" required="yes" message="Please tell me who you are."><br /><br /><strong class="smallestfont">YOUR EMAIL:</strong><br /><cfinput type="text" name="ctm_youremail" value="" style="width:250px;" required="yes" message="I'll need your e-mail address to get back in touch with you."><br /><br /><strong class="smallestfont">SUBJECT:</strong><br /><cfselect name="ctm_subject" required="yes" message="Give me an idea why you are contacting me."><option value="">-- select one --</option><option value="Technical Support">Technical Support</option><option value="Commission Inquiry">Commission Inquiry</option><option value="Friendly Hello">Friendly Hello</option><option value="Emergency Issue">Emergency Issue</option></cfselect><br /><br /><strong class="smallestfont">MESSAGE:</strong><br /><textarea name="ctm_message" rows="7" cols="50"></textarea><br /><br /><input type="submit" name="ctm_form" value="SEND MESSAGE" style="width:125px: color:#666666; font-size:10px; font-weight:bold;" /><br /></cfform></cfif></div><br />

    contactme-action.cfm

    <cfif #cgi.http_referer# CONTAINS "contactme.cfm" AND ISDEFINED("form.ctm_form")><cfmail to="#session.myemail#" from="#form.ctm_youremail#" subject="#form.ctm_subject#" server="#session.mailserver#" type="html"><br>#form.ctm_fullname#<br>#form.ctm_youremail#<br><br>#form.ctm_subject#<br>#form.ctm_message#<br><hr>IP: #cgi.remote_addr#<br>DATE: #now()#<br><br></cfmail><cfset session.contactme = "thanks"><script language="javascript" type="text/javascript">	document.location="contactme.cfm";</script><cfelse><cfoutput><script language="javascript" type="text/javascript">	alert('Invalid Page Request.\nClick OK to continue.');	document.location="#urlused#";</script></cfoutput></cfif>

    What you will see in the second codebox is how you take FORM values and use them.  There are a couple other things happening here and a couple more that I have pulled out to reduce the length of the code I pasted.If you're not using Cold Fusion this will at least get you to understand the concept.P.S.  I'm not using a thank you page in this example. I am posting back to the form page because I have logic there to prevent multiple posts within  a certain period of time - to prevent form spammers from hitting my site.

    If I am using ".php" or ".asp" instead of coldfusion, whould I just change the tags to reflect the proper script? How do I put in the email address that I want the form info to be sent to? Thanks for all your help. I am going to try some of those codes when I get a chance.
  20. Welcome to the forums.  The process that has been described goes like this:a.) code a page that has a form on it that collects the information you want.  This is done with HTML - call it contactme-form.htmb.) code a page that will process the information that is submitted by the form - call this page contactme-action.cfm.  To work "action" attribute in contactme-form.htm is set to equal contactme-action.cfm.c.) the form processing page (the action page) is processed on the server.  So a server side language must be used.  Since my example uses ".cfm" I am implying the use of Cold Fusion.  If you choose so, you can just as easily change that to ".php" or ".asp" depending on your preference or what server you have.d.) when contactme-action.cfm is done taking the form information in and sending the e-mail, then it woudl be coded to then redirect to a confirmation page - call it contactme-thanks.htm.Does this outline it a little better?All in all - you will need a server side scripting language to do this unless you find a free internet email gateway.

    That helps a little, I guess. Thanks for the help. However, how would I code the page that will process the information that is submitted by the form? Would the contactme-thanks.htm be another coded page? I use Webhost4life as my hosting server, so they support ".php" and ".asp" and coldfusion as well, I think. What are the differences between the two. Are some better used for certain uses, i.e. message boards, photo viewers, etc.? I have no idea. Thanks for all your help.
  21. So are there two problems here?I see charming4eva is inquiring about how to create a form that will email without using outlook.  The answers given (and the assumption) is correct - you will need asp, php, or cold fusion.  Each of these applications sends mail through the web server engine (which is set up to send through the a particular mail server).  However, since I think version 6.x MS SQL Server has been able to send e-mail directly (i.e. through a stored procedure).  But that was only possible if the server was set up with MS Exchange Server - but this might have changed with MS SQL Server 2005.In any respect, I would think it is safe to assume that anyone developing ins asp, php, or cold fusion is using the respective server engine to send the email via the SMTP server configured and not through the SQL server.Anymore clarification needed here?Them Mimika offers some cold fusion code (btw - nice to see another cold fusion user) in an attempt to show how a scripting language would work for this scenario. But this seems to be going in another direction.  Mimika, if you need help with you Cold Fusion issue, could you please post it in another topic so we don't hi-jack this one.Thanks

    I am in the same boat as charming4eva. I don't know what you are talking about at all. So do I have to create the page that has this email form in PHP or ASP? How do I do this in Dreamweaver? Sorry, I am really new at all this stuff and I am trying to build a website for my coming wedding. I had a little HTML in college so my background is very minor. So far, I have been reading as many sites on the web as I can and am looking at source code of pages I like to see what has been used. However, I don't understand a lot of it and some of the more advanced features, like encorporating Flash or all this ASP, PHP, etc., stuff.
×
×
  • Create New...