473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Creating e-mail form

Hi all,
I'm fairly new to creating web pages. My current site has a form that has not been working for some time. I've had several people try to fix it, but it still won't work. (long story, short version - my webhost sold to a different company who apparently did not support asp(?), so the form quit working. I changed hosts after asking for help several times and getting nothing in reply, or no help. Current host also does not support asp, and suggested I use cgi. The most recent person who worked on the form had it sending for one day, then it quit again.)

I'm wondering if it is possible to just do a "contact me" e-mail with the information in it. People can just fill out the information directly in the e-mail and send it. That way, it will come to me! (hopefully!) Is there any way of putting a "form" in a "contact me" e-mail? Also, could it be directed to a specific folder in my inbox? If you'd like to take a look, my site URL is: http://www.tanbraelabradors.com
I could really use help on this!
Sep 14 '06 #1
5 1600
steven
143 100+
You really need to know exactly what your web servers running, what's available and which method you want to use. For example, you could use PHP, but the server would also have to have a mail server installed and you have to have access permissions to use it. Then in your code, you could use the mail() command.

You could just do a mailto: link in your HTML, so that when the visitor selects it, their email client opens up and you can automatically fill the subject and address.

Routing incoming emails to different folders in your email client is something you would do using filters. For example, you could direct all incoming messaged from a specific address, or containing a specific subject to a specified directory of your choice. Using filters in modern pop clients is pretty simple and you can figure them out without the need for manuals and such. I'm sure even webmail clients provide the same features.
Sep 18 '06 #2
I have a good PHP script if you want it, you will need to know if you hosting provider allow nobody emails though, email me and I'll pass it on
jamie@2jdesign.co.uk
Oct 12 '06 #3
My current host now supports PHP, Perl, and CGI. When I switched, I don't know why the CGI stopped working, but it did. The form does work now, but I cannot just hit reply to make a response - I have to copy the sender's email address, then paste in the compose box.

When the form was working from the original host, it came to a sub-folder in my inbox, and when I was done uploading to my site, I'd just hit reply to send notification that their information was uploaded. I LIKED that! I MISS it! LOL

Not to mention, there have been so many people trying to help me, and they have made changes I did NOT want made on other pages of my site. Argh! I really need to take classes!

So, if anybody from here would like to help with another "problem", I'd appreciate it.

On this page: http://www.tanbraelabradors.com/optigen.html
which, to get here, you click on this page on the "submit" button, it should be only ONE page - the green one. One should NOT see the bottom half of the original page there! I did not intend for that bottom frame to be seen in the instructions page. I just don't know how to fix it so it doesn't show. I didn't make it, so am not sure about the coding.
Nov 10 '06 #4
AricC
1,892 Expert 1GB
Here is a pretty simple email script:


The HTML Page:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Email</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  5. <meta http-equiv="Content-Language" content="en-uk">
  6. <link rel="stylesheet" type="text/css" href="" /> </head>
  7. <body><center>
  8. <h1>Email Me (All Fields Required):</h1>
  9. <form action="Email.php" method="post">
  10. <table border="0" cellspacing="5">
  11.     <tr>
  12.      <td><font face="arial" size="2">Name</font></td>
  13.      <td><input type="text" size="30" name="Name"></td>
  14.     </tr>
  15.     <tr>
  16.      <td><font face="arial" size="2">Email address</font></td>
  17.      <td><input type="text" size="30" name="Email"></td>
  18.     </tr>
  19.     <tr>
  20.      <td valign="top"><font face="arial" size="2">Comments</font></td>
  21.      <td><textarea name="Comments" rows="6" cols="30"></textarea></td>
  22.     </tr>
  23.     <tr>
  24.      <td>&nbsp;</td>
  25.      <td><input type="submit" value="Send"><input type="reset" value="Clear"></td>
  26.     </tr>
  27. </table>
  28. </form>
  29. </center>
  30. </body>
  31. </html>
PHP script
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $my_email = "YOUR EMAIL GOES HERE";
  3. $continue = "http:google.com/";
  4.  
  5. // This line prevents values being entered in a URL
  6. if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}
  7. // Check for disallowed characters in the Name and Email fields.
  8. $disallowed_name = array(':',';',"'",'"','=','(',')','{','}','@');
  9. foreach($disallowed_name as $value)
  10. {
  11. if(stristr($_POST[Name],$value)){header("location: $_SERVER[HTTP_REFERER]");exit;}
  12. }
  13. $disallowed_email = array(':',';',"'",'"','=','(',')','{','}');
  14. foreach($disallowed_email as $value)
  15. {
  16. if(stristr($_POST[email],$value)){header("location: $_SERVER[HTTP_REFERER]");exit;}
  17. }
  18. $message = "";
  19. // This line prevents a blank form being sent
  20. while(list($key,$value) = each($_POST)){if(!(empty($value))){$set=1;}$message = $message . "$key: $value\n\n";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;}
  21. $message = $message . "Sent From YOUR SITE GOES HERE";
  22. $message = stripslashes($message);
  23. $subject = "Email From YOUR SITE GOES HERE";
  24. $headers = "From: " . $_POST['Email'] . "\n" . "Return-Path: " . $_POST['Email'] . "\n" . "Reply-To: " . $_POST['Email'] . "\n";
  25. mail($my_email,$subject,$message,$headers);
  26. ?>
  27. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  28. <html>
  29. <head>
  30. <title>Thanks You For The Email!</title>
  31. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  32. <meta http-equiv="Content-Language" content="en-uk">
  33. <link rel="stylesheet" type="text/css" href="" />
  34. </head>
  35. <body>
  36. <object><center>
  37. <h1>Thank you <?php print stripslashes($_POST['Name']); ?>!</h1>
  38. <h2>Your message has been sent</h2>
  39. <h3><a href="javascript:window.close()">Close</a></h3>
  40. </object>
  41. </font>
  42. </body>
  43. </html>
Nov 10 '06 #5
Thanks, Aric. I'll give the CGI a try. LOL, IF I can get it to work! I use Netscape Composer for creating my site, and am not certain how to get that code to show in that. If I paste it in Notepad, then open Notepad in Composer, will that work?
Nov 13 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: rdsteph | last post by:
Python411 is a series of podcasts about Python, aimed at hobbyists and others who are learning Python. Each episode focuses on one aspect of learning Python, or one kind of Python programming, and...
2
by: Pawan | last post by:
Hi Guys, I have this current assignment where I have to develop online forms for local municipal authorities. I have to use adobe acrobat to create online forms from PDFs (which I have never done...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
2
by: LIN | last post by:
Hello, Greetings. I am creating a web site which will contain lot of articles. I had been planning to create simple HTML page on the server everytime i posted a article (eg. article12.html )....
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
7
by: Gladiator | last post by:
Hai all, I have Db2 installed in a partition environment . There are 4 partitons on which i created the instance. can any one tell me if i can create a database on the required partitons .........
6
by: wcc | last post by:
Hello, How do I create a class using a variable as the class name? For example, in the code below, I'd like replace the line class TestClass(object): with something like class...
9
by: =?Utf-8?B?YmJn?= | last post by:
Hi all, I read somewhere "using kernel stuff in thread is not good.." if ManualResetEvent object is created in thread but not actually used, will it affect performance? Bob
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.