Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Help with submit buttons/
Old 03-19-2006, 04:27 AM Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
Hi folks, as you may tell im quite new to this but im looking at putting a feedback / information or booking form on my web site, however the only thing i can not get my head around is how to get the submit button to post the filled out form to my email.So in english, as i seem to be rambling , can you explain how to get the information filled in on my web page to me or my email when it is submitted.Thanks in advance for the help.RegardsElektron
elektron391 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-19-2006, 05:43 AM Re: Help with submit buttons/
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
depends on what server side code your host supports.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-19-2006, 07:05 AM Re: Help with submit buttons/
neroux's Avatar
Ultra Talker

Posts: 284
Trades: 0
You need to submit the form to a server side script which then does the processing by assembling everything together and sending the email.
__________________

Please login or register to view this content. Registration is FREE
- The world at your fingertips
• Share your city with the world

--
Please login or register to view this content. Registration is FREE
neroux is offline
Reply With Quote
View Public Profile
 
Old 03-19-2006, 07:32 AM Re: Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
How do i go about this, if it makes a difference my sever is with lycos and the web address is www.thebigbounce.co.uk.

I would realy like to include a booking / feedback form but although ok with webdesign and building, i have never had to do this before so i am really in the dark and in need of some advice.

Many thanks

Elektron
elektron391 is offline
Reply With Quote
View Public Profile
 
Old 03-19-2006, 08:22 AM Re: Help with submit buttons/
metho's Avatar
Ultra Talker

Posts: 481
Location: Gold Coast - Brisbane QLD, Australia
Trades: 0
I believe Lycos supports php. So you can have the form submit to mailer script then redirect to a thank-you page or what have you.

Links to using php mail();

Zend Mail Function
SitePoint Advanced Email
Redirecting using header()
__________________
I do
Please login or register to view this content. Registration is FREE
based.
Spend a lot of time in
Please login or register to view this content. Registration is FREE
.
And
Please login or register to view this content. Registration is FREE
chews up the rest.
metho is offline
Reply With Quote
View Public Profile Visit metho's homepage!
 
Old 03-19-2006, 12:23 PM Re: Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
Sorry for being a pain but what am i missing here I did this as a test :-

<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" u-file="C:\Documents and Settings\Tony\Desktop\_private\form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" s-email-address="myemail@lycos.co.uk" s-email-format="TEXT/PRE" --><p>
Type of inquiry</p>
<p><select size="1" name="D1">
<option>Bouncy castle Inquiry</option>
<option>Feedback</option>
<option>Other</option>
</select></p>
<p>Phone Number</p>
<p><input type="text" name="T1" size="20"></p>
<p>Inquiry</p>
<p><textarea rows="11" name="S1" cols="54"></textarea></p>
<p><button name="B1">Submit</button></p>
<p>&nbsp;</p>
</form>
</body>
</html>

I have loaded it onto my server but it does not mail the results.

i Know this may be basic stuff but I like to learn as I am working, and have never been involved with forms online.

Regards Elektron
elektron391 is offline
Reply With Quote
View Public Profile
 
Old 03-19-2006, 02:59 PM Re: Help with submit buttons/
Average Talker

Posts: 24
Trades: 0
Well as someone who was wondering the same as u are now, I've found the simplest and easiest script there is.

ALL HUGE CREDIT GOES TO Kalinga Athulathmudali, the one who built the script and helped me understand how to work with it.

here is how the script goes:

Code:
<?php 
# PHP Basic Form Mailer by Kalinga Athulathmudali 
# mail.php 
# 2006-Feb-23 
 
## Global Setings ## 
 
# Error page (if some one fail to fill the forum) 
$eurl = "error.html"; 
 
# Send Successfully Page (Confirm page that will get directed after the email was send) 
$furl = "thanks.html"; 
 
# Mail Subject 
$subject = "Test Fourm"; 
 
#################### 
 
$email = $_POST['email']; 
 
        if ($email) { 
 
        foreach ($_POST as $key => $val){ 
        $msg = "$msg \n $key    :       $val "; 
 
        } 
 
# Change the email address (admin@domain.com) to  
# where you want your mail to be send. 
 
        mail("admin@domain.com", "$subject", "$msg", 
                "From: <$email>\n" 
                . "X-Mailer: PHP Mailer\n" 
                . "Content-Type: text/html; \n charset=iso-8859-1 \n"); 
 
        header ("Location: $furl"); 
 
        } 
        else { 
 
                header ("Location: $eurl"); 
                die(); 
 
} 
?>

I'm sure u don't understand much of this code, all u need to change here is the "admin@domain.com" to your e-mail(where the info will be sent to).
In addition u can change the subject by changing this line - $subject = "Test Fourm"; --> change the name inside the "", do not remove them.

$furl = "thanks.html"; thats if all goes well where to redirect the browser to, as I mention earlier don't remove the "".

$eurl = "error.html"; if there is an error, where to redirect the braswer to.


U need to save the code in a text document and save it named as: Whatever.php


A few more thing u need to know:

-U need to check if php is activated in u'r server, if not activate it otherwise the script won't run.

-In the form code itselft notice to set the action of the sumbit button to the script, like this:
Code:
<form name="form" method="POST" action="mail.php">
-Last but not least, u need to have a e-mail in your form, the e-mail will be used as the FROM sender.

I think thats it, if u want there is a new script Kalinga released, more advanced, haven't used it yet so I can't give my opinion on it.
AirParker is offline
Reply With Quote
View Public Profile
 
Old 03-20-2006, 08:43 AM Re: Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
Thanks for that, I am slowly getting there just a few small question on the script that i dont fully understand.

When you say save it as a text document do you mean in note pad format?

You also said name it as whatever.php, I am taking it you can call it what you want .php , or does it actually have to be called whatever?

Once the text document is complete do you just upload to you servers main dir?

Finally you said you need to have email in you form, can you expalin this a little more ir is it just as in my test form above?

Many thanks

Elektron
elektron391 is offline
Reply With Quote
View Public Profile
 
Old 03-21-2006, 11:31 AM Re: Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
Can anyone help with these last few questions in the above post than i gan get cracking and have a go.

Many thanks

Elektron
elektron391 is offline
Reply With Quote
View Public Profile
 
Old 03-21-2006, 02:20 PM Re: Help with submit buttons/
trendybox's Avatar
Experienced Talker

Posts: 42
Trades: 0
Quote:
When you say save it as a text document do you mean in note pad format?
You can use notepad as an editor but make sure that when saving you change the "save as type" from "text documents(.txt)" to "all files" and save as a ".php"
Quote:
You also said name it as whatever.php, I am taking it you can call it what you want .php , or does it actually have to be called whatever?
It does not have to be named "whatever" you can name it matt.php, brittney.php, monkey.php... anything... just make sure you use the same name for it in your action of your form.
Quote:
Once the text document is complete do you just upload to you servers main dir?
Yes. Upload it to the same place the form is.
Quote:
Finally you said you need to have email in you form, can you expalin this a little more ir is it just as in my test form above?
Put a field called "email" in your form for the sender's email address.

A side note about using mail() .: be careful when using this to correctly validate the input server-side so it won't allow header injections. Header injections are when a person submits your form with malicious code in it so it will send it to other people with their own message.
__________________
-[Trendy Box]-

Please login or register to view this content. Registration is FREE

trendybox is offline
Reply With Quote
View Public Profile Visit trendybox's homepage!
 
Old 03-21-2006, 03:35 PM Re: Help with submit buttons/
AMysticWeb's Avatar
Experienced Talker

Posts: 38
Trades: 0
Looks like you built your form with FrontPage. If you want to continue with this method, you will have to turn the extensions on from the site control panel and then use the built in Publish Web option.

Try this link to fine out more. http://www.tripod.lycos.com/guides/frontpage.html

Remember to publish to http://frontpage.tripod.com/yourmembername

Additionally, at present, you have your file results pointed to your C: drive.
C:\Documents and Settings\Tony\Desktop\_private\form_results.csv

This shoulld be _private/form_results.csv

Please note your destination is utilizing backslashes. This denotes a local file path. The web path instead uses forward slashes.

PS Made a slight change to the DD HTML. If you choose to continue the form using FP, you can use the following HTML, but be sure to edit your email address.
HTML Code:
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE"
S-Email-Format="TEXT/PRE" S-Email-Address="myemail@lycos.co.uk"
B-Email-Label-Fields="TRUE" S-Builtin-Fields --><p>
Type of inquiry</p>
<p><!--webbot bot="Validation" S-Display-Name="Contact Type"
B-Value-Required="TRUE" B-Disallow-First-Item="TRUE" --><select size="1" name="D1">
<option selected>Contact Type</option>
<option>Bouncy castle Inquiry</option>
<option>Feedback</option>
<option>Other</option>
</select></p>
<p>Phone Number</p>
<p><input type="text" name="T1" size="20"></p>
<p>Inquiry</p>
<p><textarea rows="11" name="S1" cols="54"></textarea></p>
<p><button name="B1">Submit</button></p>
<p>&nbsp;</p>
</form>
</body>
</html


Looks to me like they are allowing the FP form handler. If you need help in the future with FrontPage forms, stop by my site.
__________________
Stop by for FrontPage form tutorials
and form script examples. Mike

Please login or register to view this content. Registration is FREE

Last edited by AMysticWeb; 03-21-2006 at 03:51 PM..
AMysticWeb is offline
Reply With Quote
View Public Profile
 
Old 03-21-2006, 04:53 PM Re: Help with submit buttons/
Average Talker

Posts: 24
Trades: 0
Well Elektron391, script working fine? or still haveing problems?
AirParker is offline
Reply With Quote
View Public Profile
 
Old 03-22-2006, 04:01 PM Re: Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
Working on it now Airparker, let you know in a few days either way.

Many thanks for everyones help, let know the outcome soon.

Regards Elektron
elektron391 is offline
Reply With Quote
View Public Profile
 
Old 03-23-2006, 04:00 PM Re: Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
Well I`m very nearly there, i can get the form filled in and when I press the submit button it sends the filled out form in text to my email. Fantastic.

But,

I have one problem left, when the submit button is pressed and posts, it then diverts to this page http://www.mywebsite/inquiry.php which is blank.

I can not seem to divert it to the thanks or error page to come up after submission.

below is my form page - very basic at the mo just the form and the php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form" method="POST" action="inquiry.php">

<!--webbot bot="SaveResults" u-file="inquiry" s-format="HTML/BR" s-label-fields="TRUE" b-reverse-chronology="FALSE" s-email-format="TEXT/PRE" s-email-address="myemail@lycos.co.uk" b-email-label-fields="TRUE" s-builtin-fields u-confirmation-url="thanks.html" u-validation-error-url="error.html" --><TABLE cellSpacing=0 cellPadding=0 width=495 align=center bgColor=#cccccc
border=0>
<TBODY>
<TR>
<TD width=493>
<TABLE cellSpacing=1 cellPadding=3 width=485 align=center
border=0><TBODY>
<TR bgColor=#ffffff>
<TD width=388 colSpan=2><B><FONT face=Verdana size=2>Please
fill out the form below to e-mail us</FONT></B></TD></TR>
<TR bgColor=#ffffff>
<TD align=left width=124><FONT face=Verdana size=2><FONT
color=#ff0000>*</FONT>Your name: </FONT></TD>
<TD align=left width=339><FONT face=Verdana size=2>
<!--webbot bot="Validation" s-display-name="Please Enter Your Full Name" b-value-required="TRUE" --><INPUT id=name size=47 name=name>
</FONT></TD></TR>
<TR bgColor=#ffffff>
<TD align=left width=124><FONT face=Verdana size=2><FONT
color=#ff0000>*</FONT>Your email: </FONT></TD>
<TD align=left width=339><FONT face=Verdana size=2>
<!--webbot bot="Validation" s-display-name="Please enter an e-mail address" b-value-required="TRUE" --><INPUT id=email
size=47 name=email> </FONT></TD></TR>
<TR bgColor=#ffffff>
<TD align=left width=124><FONT face=Verdana size=2>Your
Tel:</FONT></TD>
<TD align=left width=339><FONT face=Verdana size=2><INPUT
id=email0 size=47 name=Telephone_number> </FONT></TD></TR>
<TR bgColor=#ffffff>
<TD align=left width=124><FONT face=Verdana size=2>Enquiry
type?:</FONT></TD>
<TD align=left width=339><FONT
face="Verdana, Arial, Helvetica, sans-serif" size=2><SELECT
id=subject size=1 name=subject> <OPTION
value="Choose Option..." selected>Choose Option...</OPTION>
<OPTION>Bouncy Castles</OPTION> <OPTION>Feedback</OPTION>
<OPTION>Other</OPTION></SELECT> </FONT></TD></TR>
<TR bgColor=#ffffff>
<TD align=left width=124><FONT face=Verdana size=2>Your
message:</FONT></TD>
<TD align=left width=339><FONT face=Verdana size=2><TEXTAREA id=message name=message rows=6 cols=40></TEXTAREA>
</FONT></TD></TR>
<TR bgColor=#ffffff>
<TD align=middle width=388 colSpan=2><FONT face=Verdana
size=2><INPUT type=submit value=Submit name=Submit></FONT>
<P align=left><FONT face=Verdana size=2><FONT
color=#ff0000>*</FONT> indicates required
info&nbsp;</FONT></P></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM></P></TD></TR>
</body>
</html>

and the php


<?php
# PHP Basic Form Mailer by Kalinga Athulathmudali
# mail.php
# 2006-Feb-23

## Global Setings ##

# Error page (if some one fail to fill the forum)
$eurl = "error.html";

# Send Successfully Page (Confirm page that will get directed after the email was send)
$furl = "thanks.html";

# Mail Subject
$subject = "inquiry";

####################

$email = $_POST['email'];

if ($email) {

foreach ($_POST as $key => $val){
$msg = "$msg \n $key : $val ";

}

# Change the email address (admin@domain.com) to
# where you want your mail to be send.

mail("myemail@lycos.co.uk", "$subject", "$msg",
"From: <$email>\n"
. "X-Mailer: PHP Mailer\n"
. "Content-Type: text/html; \n charset=iso-8859-1 \n");

header ("Location: $furl");

}
else {

header ("Location: $eurl");
die();

}
?>



I am so close, but just a step away, would be greatful for your time and help.

Regards Elektron

Last edited by elektron391; 03-23-2006 at 04:06 PM..
elektron391 is offline
Reply With Quote
View Public Profile
 
Old 03-23-2006, 04:58 PM Re: Help with submit buttons/
Average Talker

Posts: 24
Trades: 0
I uploaded your form+php to my site, and it does redirect after sumbiting the info.
Didn't change a thing, maybe just check if the link u got in the php, the error.html or thanks.html, make sure their files are in the same folder as the php file, if not change the realtive link to it.
Notice maybe capital latters has to do something with it..

Last edited by AirParker; 03-23-2006 at 05:00 PM..
AirParker is offline
Reply With Quote
View Public Profile
 
Old 03-23-2006, 05:05 PM Re: Help with submit buttons/
Average Talker

Posts: 24
Trades: 0
Btw, u can use the
Code:
onsubmit="MM_validateForm
To actually force ppl to fill the requierd lines..
AirParker is offline
Reply With Quote
View Public Profile
 
Old 03-23-2006, 05:58 PM Re: Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
It is still sticking on http://www.mysite/inquiry.php empty page after submission.

It does redirect to any other page, I have checked thanks.html and error.html are there and if i type http://www.mysite.co.uk/thanks,html the thanks page is there.

It seems to redirect it to http://www.mysite/inquiry.php but thats it, blank page.

any ideas.

regards Elektron
elektron391 is offline
Reply With Quote
View Public Profile
 
Old 03-24-2006, 01:26 PM Re: Help with submit buttons/
Novice Talker

Posts: 9
Trades: 0
Yipeeeeeeeeee got it working, Airparker I used the 2nd php script you pointed me to.

so now for the last 2 dumb questions.

1 Where do i put the code to force the fields to be entered.

2. how do i get the finished email to split each section onto seperate lines so the email si not just one long line.

Thanks for all your help iI have learnt much doing this.

If anyone can help with the above it will be the icing on the cake

Regards Elektron

Last edited by elektron391; 03-24-2006 at 03:28 PM..
elektron391 is offline
Reply With Quote
View Public Profile
 
Old 03-24-2006, 05:09 PM Re: Help with submit buttons/
Average Talker

Posts: 24
Trades: 0
Quote:
Originally Posted by elektron391
Yipeeeeeeeeee got it working, Airparker I used the 2nd php script you pointed me to.

so now for the last 2 dumb questions.

1 Where do i put the code to force the fields to be entered.

2. how do i get the finished email to split each section onto seperate lines so the email si not just one long line.

Thanks for all your help iI have learnt much doing this.

If anyone can help with the above it will be the icing on the cake

Regards Elektron
1.Click on the form tag,go to the behaviors tag on dreamweaver8-->click the Add button, Validate form, u'll see the rest from there.

2.change this line in the php script:
Code:
$msg = "$msg \n $key    :       $val ";
to:

Code:
 $msg = "$msg <br> $key    :       $val ";
That should work..
AirParker is offline
Reply With Quote
View Public Profile
 
Old 04-18-2006, 06:37 AM Re: Help with submit buttons/
Junior Talker

Posts: 2
Trades: 0
nice to see that you guys are happy with my script

well, it has ben updated few time now, so you can find the up-to date ver of the script here

http://www.onetforum.com/formmailer/



1. Support Any HTML Form with unlimited no of Form Feels

2. Support forward to a pre defined web pages for each successful submit or if there was an error.

3. Support simple customizable message display if no pages defend for successful submit or for errors with a Go Back button (link)

4. Display the IP & Browser information of the person who submit the form.

5. Stop User form Submitting black Forms.

6. Support pre-defined email address or automatically use if there is a field call email in the HTML form to use as the Mail From address in the email it send.

7. Email address validation, (validate the syntax of the email address that was submitted)

8. Ability set mandatory form fields.

9. Send the form in HTML table format.

10. Alerts like Blank Form, Blank Mandatory felids etc has been move to java alerts where a Message Box will display the error

11: Include an Image Based Validation to prevent automated form submitting. (Beta)


have fun
__________________
ORBIT NETWORK

Please login or register to view this content. Registration is FREE

The web just got better...

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
kalinga is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with submit buttons/
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.81192 seconds with 12 queries