Astahost.com   Mar 11, 2010
Open Discussion & Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

Creating Forms? :s? Help!

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

Creating Forms? :s? Help!

pokerforce
Hi seeing as i SUCK at web building i need help.
ok what i'm trying to do is, if i press a link, a new small window will show up in which there is a form

In the form you have to enter the following details

FirstName:
Last Name:
Account Number: (starting with RVRP)
Date Deposited (format MM/DD/YYYY)
Date Completed (format MM/DD/YYYY)
Email Address:
Amazon: (choice between Amazon.com , Amazon.ca , Amazon.co.uk) drop down menu would be good for this.

and a submit button which will send the details to my email.
once its done, a "warning" type window should show up saying "Thank you for Registering, We will get back to you within 72 hours"

furthermore, if any of the field is not written in, the form would appear again saying which field hasn't been filled in etc, and if the format is wrong (ie the date, the same will happen..)

how do i make such a thing? i know it's supposed to be easy but my head is hard as a rock..

Comment/Reply (w/o sign-up)

Hercco
You can't do it with just HTML, you need something for the mail sending. Well actually you can do it, but its real clumsy and awful method.

The form itself is easy to do, just plain HTML.

It could look something like this:

CODE
<form action="[mailing script]" method="post">
<label for="firstname">First name</label>
<input type="text" id="firstname" name="firstname"/>

(and so on..)

<input type="submit" value="Send"/>
</form>

[/CODE]

<label>s are a modern and stylish way to do this, and to make them look good you need to do some CSS. Other way, the typical one, is to build a table with the form elements inside the cells.

For the dates and the amazon thing you could use select elements:

CODE
<select name="amazon">
<option value="com">Amazon.com</option>
<option value="de">Amazon.de</option>

and so on
</select>




So far pretty straight forward. Next you need to do some programming.
[/CODE]
You need to have a program in the server to send the mail. Probably easiest way to do it is PHP.

Basically all you need to send email in PHP is to call function called mail(). As parameters it takes email address (where the message is to be sent), subject, the message itself and headers.

You can access the data from the form with $_POST['variable'], provided that you used post as method instead of get. For mailing, post is recommended.

Before calling mail, you need to do some processing with your data. You can do checks wether the fields are filled correctly and so on. Then you need to compile the information into the message format. I'd also recommend adding some headers to make the mail a little neater and easier for the recipient (ie. you) to reply.

The very basic script could look something like this:



CODE
<?php

$message = 'Firstname: '.$_POST['firstname']. "\n".
.'Lastname: '.$_POST['lastname']."\n";

and so on...


$headers = "Reply-To: ". $_POST['email']."\n";
$headers .= "X-Mailer: PHP/" . phpversion();

mail('your@email.com', 'Subject', $message, $headers);

?>



You can of course format the message in anyways you see best, even use HTML if you like HTML mail. For the header, you can do lot of things, if your interested google or visit php.net.

The above script should work, but its recommeded to at least check that the mailing works and then print out a message for the user. Mail returns true if the message was sent, false if not.

So to check and print the message:

CODE
if ( mail( ----stuff inside----) )
{
[tab][/tab]echo "Mail was sent";
}
else
{
[tab][/tab]echo "Mail was not sent";
}
;



Hopefully this helped to get you started.

 

 

 


Comment/Reply (w/o sign-up)

Houdini
I just noticed that you are not yet a hosted member, and I looked over the requirements of your form, which would work weel with PHP or Perl (I prefer PHP) but when you get a hosting account with astahost there is a cgiecho in the cgi-bin and there is also a cgimail from Matts Archive Scripts, there is a link in the C Panel to let you know how to set up the fields in your form and just for the heck of it I am playing with it, and also some other Perl scripts from Big Nose Bird that handles emails with TLDs of four charachters like .info or .name.

You would use the cgiecho to test out your form and then view the results on your browser. Writing your script is not that difficult since it is just an HTML form and if necessary you can use JavaScript to force completion of fields even before submission (an alert tell them the form and what fields have not been filled out), but validation is not the same as verification, so a bogus email would only be verified by requiring a to get a carbon copy of the email and have a receipt requested, so you are getting into deep water there.

If you would like to see what I have come up with that at least meets the form requirements then PM me.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Creating Forms Help33

  1. Creating Links With Quotes (") - (2)
  2. Advanced Form Question - Advanced Forms (0)
    Alright...this might be a little hard to understand, but I'll try to make it as easy as
    possible. http://www.directamish.com/orderform.htm What you will see here is just a form that
    has a javascript to do addition and subtraction and keeps a running total at the bottom of the page.
    I want to keep this part of the form, but I want to add some things to it and I'm not sure how.
    At the very top of the form, I want to have, say, Package 1, Package 2, Package 3 for example,
    all three in radio buttons. Below that, I want to have a list of options, quite a fe...
  3. How Do You Create Web-Forms? - HOw the hell!!! (8)
    ok im new to the web creations scean and i ahve no idea how to do forms everything i try it tells me
    that iv not done it right but then again its proberly FP which i hate but hey u gotta do what you
    gota do ok so can anyone help me?...
  4. How To Get Two Web-forms To Work Together ? - (7)
    Does anyone know how to get two forms to work? I have a login on the navigation bar and a
    commenting box on the middle table. However, the sumbit button in the commenting box responds the
    login form. If not, is there a way to get something like this to work: A login and a commenting
    box....
  5. Creating Expanding Menu Tree In A Web Page - sharing my knowledge (7)
    hey guys... im here to share some tricks i picked up along the way in creating or designing web
    pages... this trick is making an expanding tree menu like the one you can find in the Windows
    Explorer.. very cool eh! the trick is done by using javascript and some of its objects.. so here we
    go Lets say for example you want to create this tree menu Fruits Apple Small
    Medium Large Grapes With seeds Seedless Banana Green Yellow and
    you want to make this menu collapse or expand when click the first we do is encode this smal...
  6. Forms - (2)
    Ah yes, the magical and dreaded form. Anyways, just a small question regarding them. I've
    checked a few pages out that talk about the "action" prompt in the form coding. What I'm trying
    to achieve is having the form email an account of mine when the user hits "submit". Now I know the
    old, easy way out of this was to have action="mailto:my.email@my.email.box.com". After reading a bit
    on this (and trying it myself), I've discovered this is not a suitable solution. What happens
    when you use mailto in the form is when submit is clicked, it opens up your default...
  7. Interesting Ways Of Creating Web Pages - Do you have any good ones? (14)
    I'm curious as to how you guys put together web pages. Me, I just use an interesting
    combination. First I go into Microsoft Word and save the document as a blank HTML file, then I add
    the code in Notepad (that's why I'm able to complete my web sites so quickly). Do you have
    any interesting ways of doing things?...
  8. Creating Dhtml Menu - do you know how to create cool menu? (2)
    I've searching for a while, but never could find the best solutions for menu design. could
    anyone tell me where to find the best site that provide DHTML menu creation?....
  9. Creating Framework For A Website - How do I re-use page with different data (1)
    I'm working on the outline for a new website, the theme is in place, framework based on CSS.
    One of the problems I have is with recurring data. I have an index listing multiple objects. The
    objects are similar and the descriptions are similar. So for me to have that data in this format
    and diplay using as little resources as possible: Object one, description 1 Object 2, description
    2 Object 3, description 3 all have the same format. The object is a picture and description is
    -duh- description. Page layout are the same for each page it's just the data changi...
  10. When Creating An Sql Connection Using Sql Server Y - (0)
    Configure the server alias Create the SQL connection. Configure the Server alias Open SQL
    Server Client Network Utility. When Client Network Utility opens, click on the Alias tab. Click
    on the Add button. In the Server Alias text box enter a name for your SQL connection. Select
    TCP/IP under Network libraries Enter the IP address of the Server your SQL database is located on,
    in the Server name text box. Click on the OK button. Your Server alias will now be configured,
    click on the Apply button. Click on the OK button....
  11. Creating Cool Web Sites with HTML, XHTML and CSS - (0)
    Whether you're building a sophisticated commercial Web site or just creating an online spot to
    call home, good Web site development is about a lot more than just HTML nowadays, and Creating Cool
    Web Sites spends lots of time exploring the nuances of xhtml and Cascading Style Sheets in a way
    you're sure to understand. Incorporating the best of Creating Cool HTML 4.0 Web Pages and
    Dynamic HTML Weekend Crash Course, this book adds tons of critical new and updated information on
    xhtml, CSS, JavaScript, page validation, weblogs and weblog tools, optimal search engine ...



Looking for creating, forms, s



See Also,

*SIMILAR VIDEOS*
Searching Video's for creating, forms, s
advertisement




Creating Forms? :s? Help!

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com



Creative Commons License