PDA

View Full Version : Email Forms



Anonymous
05-14-2005, 08:39 PM
Thanks for all previous help - things moving along quite nicely! :D
Next question!! I've composed a form on a page that I've called Contact Us. The idea being - a visitor fills it in - presses the button and Hey Presto - the completed form arrives in my in-box! I've watched the relevant Tutorial (8 million times!).
I've published the page and tested it. I can fill the form in, but when I press the submit button - it just gives me the option to send an email. The completed form is not sent - but at least I'm halfway there. How should I configure the form to make it work properly?

Anonymous
05-14-2005, 09:54 PM
Sending (client sided) forms from a PC works like this:
Your browser creates a email message and will use your default email client to send this message (using MAPI).
To configure your default email client:
Internet Explorer Menu->Tools->Internet Options->Programs->Email
Select your email client (prefferable Outlook Express).
Also make sure it's the default MAPI client:
In Outlook Express->Menu->Tools->Options->General Tab
and click This application is the default Mail Handler ->Make Default

If you like you can read the following internet articles for more details:
http://webdesign.about.com/cs/forms/a/aamailtobroke.htmor
http://support.microsoft.com/default.aspx?scid=kb;en-us;186229
or
http://support.microsoft.com/default.aspx?scid=kb;en-us;279460

But since you're using Vodahost you can alos use a PHP script to create a more reliable solution.

Anonymous
05-14-2005, 09:58 PM
I have created an example script for you that processes your form succesfully using a generic PHP script.

Instructions:
Change the form properties (in BlueVoda) to:
Action: FEEDBACK.PHP
Method: POST
EncodingType:
(remove the text/plain, so the field becomes empty)

Now create a new file using Notepad and call it: FEEDBACK.PHP
Enter the following code into the file:


<HTML>
<HEAD>
<TITLE>Thank you for your feedback</TITLE>
</HEAD>
<BODY>
<H2>Thank you for your feedback!</H2>
<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "feedback@yourdomain.com";
$mailsubj = "Feedback form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
</BODY>
</HEAD>

Upload this file to your domain.

Judy Khoo
05-27-2005, 02:09 PM
Hi

I have used the example script you gave and I have no problem in getting the mail sent out.

However, when I open the mail from my mail box, I find the following message was sent:

Values submitted from web site form:
Name : test
Email : judyksp********.com
S1 : test
Submit : Send


and the sender is unknown.

how can i correct this to reflect the right information from my email form?

I have three fields in the form I created:

a. Name - where the user is to type his/her name
b. email - where the user is to type his/her email address
c. Message - a free text area for the person to type the message

I am extremely new to web hosting and scripting. I have no knowledge of PHP either. Hope you can assist.

Pablo
05-27-2005, 03:26 PM
Since the email is send from the server where your domain is running on you can't see the actually sender (since it's the vodahost server that sent you the message when the form is submitted). But your visitors should enter there email address in one of the fields you create with BlueVoda.

Looking at the data you received in the message, it looks like you already have a field for the email address?

Pablo

Judy Khoo
05-27-2005, 06:11 PM
So what I saw in the contents of the mail is what the visitor would have typed, right? And if I wish to reply to them, it would be to the email that was displayed in the message, right?

Thanks.

Pablo
05-27-2005, 06:41 PM
Absolutely correct.

Judy Khoo
05-28-2005, 06:27 AM
Thank you very much for your assistance.

I have one more request and hope you can help.

Currently, your scripts returns a message on successful submission on a new page. How do I get to change it to show on the same page but perhaps at the bottom of the screen? Or if I have to do it on a new page, how do I get to format the page to look better?

Pablo
05-28-2005, 07:31 AM
There is currently no easy way to do this, but here something that might work for you:

1. Create a new page with BlueVoda and save is as 'feedback.bvp'.
2. Select View->Page HTML from the menu
3. Select the Inside Body tag and enter this code:

<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "feedback@yourdomain.com";
$mailsubj = "Feedback form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
4. Do the usual page formatting.
5. Publish the page to your VodaHost account.
6. Login to your cPanel and select File Manager to rename feedback.html to feedback.php
Of course you can also use your favorite FTP client to rename the file.

Pablo

Judy Khoo
05-28-2005, 07:37 AM
Thanks. I will try it. Meanwhile, just a question - do I have to remove the earlier feedback.php that was created and replace with this new php?

VodaHost
05-28-2005, 08:15 AM
yes please

Judy Khoo
05-28-2005, 01:56 PM
Thank you for the script. It works.

busymomz
06-09-2005, 02:23 AM
I'm a bit new to all this, and I happened to stumble across your discussion which was just what I was looking for, and I needed some help.

I have tinkered with the code here and there getting farther and farther along, until I have hit a barrier. When I press my submit button, I get a message that says "No Input File Specified".

Any Idea what to do?

Thanks

VodaHost
06-10-2005, 05:23 PM
have you named your php file correctly?

busymomz
06-14-2005, 07:38 PM
OK, I figured it all out, and now I'm up and running.
However, I would like to create another type of form but am not sure how to do it.
I just need to be able to have the user define what email the form is sent to.
Is this possible?

allan
06-19-2005, 05:56 PM
How do I upload this to the domain? I know, I know, I don't know that much about all these stuff. Thanks for your help Pablo. Hey you look like the whatyoumacallit guy in the movie Matrix but I think Susan looks better than you. :)



I have created an example script for you that processes your form succesfully using a generic PHP script.

Instructions:
Change the form properties (in BlueVoda) to:
Action: FEEDBACK.PHP
Method: POST
EncodingType:
(remove the text/plain, so the field becomes empty)

Now create a new file using Notepad and call it: FEEDBACK.PHP
Enter the following code into the file:


&lt;HTML>
&lt;HEAD>
&lt;TITLE>Thank you for your feedback&lt;/TITLE>
&lt;/HEAD>
&lt;BODY>
&lt;H2>Thank you for your feedback!&lt;/H2>
&lt;?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "feedback@yourdomain.com";
$mailsubj = "Feedback form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
&lt;/BODY>
&lt;/HEAD>

Upload this file to your domain.

allan
06-19-2005, 06:13 PM
Ooops! I meant Sarah! :)


How do I upload this to the domain? I know, I know, I don't know that much about all these stuff. Thanks for your help Pablo. Hey you look like the whatyoumacallit guy in the movie Matrix but I think Susan looks better than you. :)

Pablo
06-19-2005, 06:21 PM
Ooops! I meant Sarah! :)

Well, Allan fortunately we are not hired for our looks...

Sarah
06-19-2005, 06:22 PM
use blueftp

George
06-19-2005, 06:24 PM
I think Sarah hired me for my looks :)

VodaHost
06-19-2005, 06:37 PM
yes, George we hired you for your good looks. Also it does
not hurt any that your father owns our office building;)

allan
06-19-2005, 07:32 PM
use blueftp

What blueftp? Please give me step by step instruction. You lied to me. You said that your job was just bringing ***** coffee. You took advantage of a newby. :)

allan
06-19-2005, 07:34 PM
yes, George we hired you for your good looks. Also it does
not hurt any that your father owns our office building;)

Ooooh, I see. Insider trading.

VodaHost
06-20-2005, 04:56 PM
You will find BlueFTP in bluevoda

tools > FtPManager

Stroke.nz
07-19-2005, 05:36 AM
Is there a script to make sure the client wrights a message into the fields before submitting?

Also is there a time limit script for clients sending emails, to stop spamming by mistake.

Stroke.nz
07-21-2005, 07:44 AM
For Fields
Place in the head section of the page

<script>

function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.name.substring(0,8)=="required"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charA t(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("One or more of the required elements are not completed. Please complete them, then submit again!")
return false
}
else
return true
}
</script>
Add this to the "INSIDE TAG" of your form

<form onSubmit="return checkrequired(this)">

then lastly add "required" to each of names you called your boxes i.e. requiredname


Submit Button

Place in the head of the page

<script type="text/javascript">

//Enter error message to display if submit button has been pressed multiple times below.
//Delete below line if you don't want a message displayed:

var formerrormsg="You\'ve attempted to submit the form multiple times.\n Please reload page if you need to resubmit form."

function checksubmit(submitbtn){
submitbtn.form.submit()
checksubmit=blocksubmit
return false
}

function blocksubmit(){
if (typeof formerrormsg!="undefined")
alert(formerrormsg)
return false
}

</script>

then add the red part in after tag of the form
"
<input type="submit" value="Submit" onClick="return checksubmit(this)">
</form>

Thanks to Simon

marton23
09-11-2005, 06:30 PM
hey i need a pass and username to publish it where do i get it do i have to pay?

Maddog
09-13-2005, 07:13 PM
hey i need a pass and username to publish it where do i get it do i have to pay?

goto

http://www.vodahost.com/

rana
10-09-2005, 03:49 AM
Hi,

I am having serious problem running a SIMPLE email PHP script !

The emails are just not reaching any mailboxes.

The script -> (http://qmsys.info/mail.php)
<?
$result = mail("sanjeev.rana@hewitt.com", "the subject", "Line1","From: qm@qmsys.info\n");
if ($result == TRUE)
echo "Success";
else
echo "Failed";
?>

What am I doing wrong ?? Everytime the output is "Success", however NO EMAIL :-(

Please assist ASAP.

Girlonthehill
10-19-2005, 10:58 PM
Hi Dave (and anyone else who may be able to help)

Your advice, via the VHCF, have helped me a lot - thanks. A quicky about this one - I thought I could, maybe, adapt it to fit my needs -

where do I use this script? Does it go in an HTML box on the relevant BV page? or do I need to create something new? Soz - I'm a bit green at all this. Thanks for any help you can add.




For Fields
Place in the head section of the page

<script>

function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.name.substring(0,8)=="required"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charA t(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("One or more of the required elements are not completed. Please complete them, then submit again!")
return false
}
else
return true
}
</script>
Add this to the "INSIDE TAG" of your form

<form onSubmit="return checkrequired(this)">

then lastly add "required" to each of names you called your boxes i.e. requiredname


Submit Button

Place in the head of the page

<script type="text/javascript">

//Enter error message to display if submit button has been pressed multiple times below.
//Delete below line if you don't want a message displayed:

var formerrormsg="You\'ve attempted to submit the form multiple times.\n Please reload page if you need to resubmit form."

function checksubmit(submitbtn){
submitbtn.form.submit()
checksubmit=blocksubmit
return false
}

function blocksubmit(){
if (typeof formerrormsg!="undefined")
alert(formerrormsg)
return false
}

</script>

then add the red part in after tag of the form
"
<input type="submit" value="Submit" onClick="return checksubmit(this)">
</form>

Thanks to Simon

vugter
10-27-2005, 01:27 PM
Hello,

Anyone got a script i can paste in the 'recommended' php script email form from Voda to:

- Make sure all values are entered
- A valid email is entered
- The form is cleared after it has been sent

Thanx

Paul

Trigger004
11-02-2005, 09:06 AM
Hello,

Anyone got a script i can paste in the 'recommended' php script email form from Voda to:

- Make sure all values are entered
- A valid email is entered
- The form is cleared after it has been sent

Thanx

Paul
when you go to toturials bluevode videos, and your watchen that video about how to make a simple form look at the bottom of that and it will have it there
HAVE FUN!

vugter
11-03-2005, 12:45 PM
Thanx Trigger, but that is the form I now have.

This form doesn't do the things I mentioned http://www.vodahost.com/vodatalk/images/icons/icon11.gif
Any more suggestions??

Rubicon
11-16-2005, 01:23 AM
On my form I have an upload box for viewers to submit pictures. I have tried to test my form sending a picture to myself. When I check my email
there is no information what so ever! I've tried sending to my outlook express account, and my ISP account. Below is what I receive.

Outlook account:
Attach: POSTDATA.ATT


ISP account:
Attachment 1: POSTDATA.ATT (http://mailcenter2.comcast.net/wmc/v/wm/43791FEB0002983F00005006220702065304070E039C0A0307 08/POSTDATA.ATT?cmd=MimePart&no=65&uid=7871&sid=c0&format=raw&mimepart=1&content_type=application/octet-stream&name=POSTDATA.ATT) (application/octet-stream)

When my form is set to multipart/form-data I receive only the above.

When my form is set to text/plain, I recieve all information, but only the file
name of the attached picture.

What am I doing wrong?

civcivcikcikder
11-22-2005, 06:07 PM
Hi...
Another question :
After submitting the form, "thank you for your feedback" page opens... Are there any way to put that page a home link... I mean it is a little bit funny to go back with the back button of the browser...! Think that you have a website , but the visitor must use the back button... Thanks a lot...

simranpal
01-29-2006, 11:03 AM
hi

adnankyo2006
02-21-2006, 05:37 PM
hello how are you.i hope you are a fine . i am Kyo.my nick name adnan.

sandeepvelpula
03-05-2006, 09:18 PM
Hi iam sandy
my date of birth is same is also on same day