Jump to content

Basic Form!


aamberker

Recommended Posts

Hi,1. Under html page I have placed 3 tables.2. Under first table I have typed the text as "Name" without form tag3. Under second table I have just insert the "Text Box" without form tag.4. Under third table I have insert "Submit" button without form tag.When someone put their Name under "Text Box" and hit the "Submit" button, the information (The word "Name" and their actual Name should reach to my email ID.HOW DO I DO THIS? Perhaps you may need the following information to teach me - http://mirroremage.com/cgi-sys/FormMail.cgiWith Warm Regards,Amit ~

Link to comment
Share on other sites

Well, your explanation is a bit vague, and your link is to a CGI script that doesn't seem to produce any relevant code, so it's kind of hard to give you any advice. Maybe you can find the information you need here:http://www.w3schools.com/tags/tryit.asp?fi...tml_form_submitOf course, none of this will help if the problem is the actual script that you're using as the form's target (and not the form itself). But without seeing the source code for that script, it's hard to say what your problem is.RMN~~~

Link to comment
Share on other sites

So what i think your saying is you want a form that when submited will send the message and name to your email well here would be the HTML code for the form you can edit it any way you want it

<FORM action="" method="post"><TABLE WIDTH="90%" BGCOLOR="#FFFFFF" ALIGN="center" CELLSPACING="1" CELLPADDING="4" BORDER="1"><TR><TD>Name</TD><TD><input type="text" name="name" style="width:250px"></TD></TR><TR><TD>Message</TD><TD><textarea cols="50" rows="10" name="msg"></textarea></TD></TR><TR><TD> </TD><TD><input type="submit" name="submit" value="Submit form"></TD></TR></TABLE></FORM>

but when it comes time to processing the form i would recommend PHP but its up to you but if you were going to use PHP for the sending part you could use a mail() function it would look something like

<?phpif($_POST['submit']){$name = $_POST['name'];$msg = $_POST['msg'];if(!$name){echo "<script language=javascript1.1>alert('Please enter a name'); java script:history.back();</script>";}elseif(!$msg){echo "<script language=javascript1.1>alert('Please enter a message'); java script:history.back();</script>";}else{mail("youremail@yoursite.com", "Form", "Name : $nameMessage : $msg");echo "<script language=javascript1.1>alert('Your message has been sent'); java script:history.back();</script>";}}?>

Link to comment
Share on other sites

Oh Gawd!... One NEWBIE is teaching to another NEWBIE... How funny!... Knock! Knock! Any professionals over there???
This "newbie" happens to have about 10 years' experience of web development. :):) If you don't explain exactly what you want to achieve, it's hard for anyone, "newbie" or "professional", to give you detailed advice. The link you posted, for example, produces exactly this code:
<html><head><title></title></head><body bgcolor="#FFFFFF"><table><tr><td bgcolor=#cccccc>FormMail-Clone</td></tr><tr><td>This is FormMail-clone, a clone of FormMail.cgi.  It is a clean room version for legal purposes (a less restrictive liscense), but should behave the exact same way as Matt Wright's Original, but contain none of his code.</td></tr></table></html>

Not exactly self-explanatory, is it...?RMN~~~

Link to comment
Share on other sites

Oh Gawd!... One NEWBIE is teaching to another NEWBIE... How funny!... Knock! Knock! Any professionals over there???
Just because someone is a newbie, doesn't mean they cant try and help anyone, for all oyu know, they could be a great coder, and just have signed up to this forum to help people! Anyway, could you possibly send a pic of what you are trying to do, and then I will try to make it for you.
Link to comment
Share on other sites

Hi EdwardHey, I didn't mean to hurt the other newbie's feelings. FYI, I have apologize that newbie after knowing that they happens to have about 10 years' experience of web development. Yeah my dear friend, I do agree with you that just because someone is a newbie, doesn't mean they cant try and help another newbie. But you see, that was just a simple slang I used. However I am sorry. Well, thanks for saying that you will try to make it for me. Pull the following URL -http://www.mirroremage.com/basic_form.html And you will know what exactly I would like to learn.With Warm Regards,Amit ~

Link to comment
Share on other sites

Pull the following URL -http://www.mirroremage.com/basic_form.html And you will know what exactly I would like to learn.
That page has three forms, and none of them has an action defined, so they don't actually do anything. You don't need the tables and you don't need separate forms (in fact, you need all controls to be part of the same form, if you want it to work).But, most of all, you need to define an "action". The form needs to send its data to some program or script running on the server. This is assuming you want to do something with the "name", of course. Check the link I posted above (which I guess you didn't even try), it explains how to construct the form itself.As to the script, unless you're using some script made by someone else (and in that case you need to follow its instructions), you're going to need to write it in a language like C, ASP, PHP, Perl, etc., and configure the server to run it.You can also make a form that sends information to another HTML page, where in turn you use a JavaScript script to do something, but the possibilities are more limited.RMN~~~
Link to comment
Share on other sites

Hi EdwardHey, I didn't mean to hurt the other newbie's feelings. FYI, I have apologize that newbie after knowing that they happens to have about 10 years' experience of web development. Yeah my dear friend, I do agree with you that just because someone is a newbie, doesn't mean they cant try and help another newbie. But you see, that was just a simple slang I used. However I am sorry. Well, thanks for saying that you will try to make it for me. Pull the following URL -http://www.mirroremage.com/basic_form.html And you will know what exactly I would like to learn.With Warm Regards,Amit ~
No, its fine, here is the code that you need to use to make a form like that...
<html><head><title>Your Title</title></head><body bgcolor="#000066" link="blue" vlink="blue"><font size="3"><font face="Arial"><font color="black"><center><table border="0" cellpadding="100" cellspacing="0" width="85%" bordercolor="#000000" bgcolor="#FFFFFF"><tr><td><BR><font size="5"> <center><b><u>Your Title</u></b><BR><BR></center><font size="2"><FORM METHOD=POST ACTION="mailto:your email?subject=your subject" ENCTYPE="text/plain"><fieldset style="padding: 10px; border: #000066 solid 3px;"><legend><b>Your Name / Nickname</b></legend><BR><INPUT TYPE="text" NAME="Guests Name" SIZE="30"><BR><BR></fieldset><BR><fieldset style="padding: 10px; border: #000066 solid 3px;"><legend><b>Submit / Reset</b></legend><BR><center><INPUT TYPE="submit" VALUE="Submit Post" onclick="window.location='thankyou.html';">   <INPUT TYPE="reset" VALUE="Clear Post"></center><BR></fieldset><BR><BR></form>N.B. A warning message may appear when you click submit post, this is asking if you would like to continue, click yes and yes again to both warning messages. Please note that moderating of posts may take anything up to a week to process, please do not submit a post more than once.<BR><BR><p style="background: #fcfbff; border: 1px dashed silver; padding: 8px; font-family: Arial"><em>Depressingly Necessary Privacy Policy:</em><br />Your privacy is always important and because we know it is so important any of your details will never be given out to any third parties or sold to anyone, for more information on this matter please visit our <a href="privacypolicy.html">Privacy Policy</a>.</p><center><BR><form> <input type="Button" value="Back" onclick="history.back()"</form><BR><BR>______________________________________________________<BR><font size=1>Your Name, Your Company Name/Website Name, <a href="mailto:Your Email">Email Me</a></center></td></tr></table></center></body></html>
There, a fully working HTML page, once you have changed a few things that are in bold. It is also important to note that for this pages links to work, you need a page called privacypolicy.html and also a page called thankyou.html.Just take whatever bits of code you need, but use the whole lot if you like. :)
Link to comment
Share on other sites

Newbeis,. and people with ten year experience. I think you all are great.The true Newbies (myself) are learning, The fake Newbies ( experienced with 10 years) are providing some great help and i thank you for being here. The punks ( the ones that start ###### ( no one in here offcourse) they give us a laugh every now and then.THANK YOU ALL, THIS PLACE IS GREAT

Link to comment
Share on other sites

Newbeis,. and people with ten year experience. I think you all are great.The true Newbies (myself) are learning, The fake Newbies ( experienced with 10 years) are providing some great help and i thank you for being here. The punks ( the ones that start ###### ( no one in here offcourse) they give us a laugh every now and then.THANK YOU ALL, THIS PLACE IS GREAT
Lol, some of your guys really do come up with some funny replies, did the code that I send you work? It seemed to on IE 6 but then again I didn't have any time to check it on FF. And I don't have any other browsers. If it doesn't work or it is not what you want, just let me know and I will do my best to try and rectify it.
Link to comment
Share on other sites

You are labeled a "Newbie" when you have sent under 10 posts, a "Member" when you have over 10 posts and an "Advanced Member" when you have I think it is 15 posts. After that I think 500 posts lets you change the label to whatever you like. And I really am not sure after that. I really want to know how many posts you need to be able to add your picture to your profile.

Link to comment
Share on other sites

  • 3 weeks later...

Hi To All :) I AM BACK!... At-last I learnt how to do a VERY basic form. Pull the following URL and check the source - http://www.mirroremage.com/amit.htmNow I would like to do the same form to work within my server instead of using "Microsoft" default and "Outlook Express".Please help!Look look forward to hearing from you soon.With Warm Regards,Amit ~

Link to comment
Share on other sites

Oh Gawd!... One NEWBIE is teaching to another NEWBIE... How funny!... Knock! Knock! Any professionals over there???
That was really pointless... This guy took some of his time trying to help you with your unclear questions/informations.That's really not cool from you.
Link to comment
Share on other sites

That was really pointless... This guy took some of his time trying to help you with your unclear questions/informations.That's really not cool from you.
Dude, I asked him sorry and we are friends now :) I have patched-up with that guy... And yeah!... I agree with you that was really not cool from me... However I am sorry to you too for that pointless :)
Link to comment
Share on other sites

  • 1 month later...

Gosh, what newbies are you talking about? So , Amit, what are you trying to do?On my opinion....

<html><body><form action="MAILTO:someone@w3schools.com" method="post" enctype="text/plain"><h3>This form sends an e-mail to W3Schools.</h3>Name:<br><input type="text" name="name"value="yourname" size="20"><br>Mail:<br><input type="text" name="mail"value="yourmail" size="20"><br>Comment:<br><input type="text" name="comment"value="yourcomment" size="40"><br><br><input type="submit" value="Send"><input type="reset" value="Reset"></form></body></html>

And it does this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...