Results 1 to 6 of 6

Thread: Forms Drive Me Nuts!

  1. #1
    Join Date
    Apr 2003

    Forms Drive Me Nuts!

    Here is the source code...

    <META http-equiv="Page-Enter" CONTENT="RevealTrans(Duration=2,Transition=3)">
    <TITLE>Prayer Requests</TITLE>
    <body bgcolor="#3399FF">
    <body text="black">

    <H1>Prayer Requests</h1>
    <h3>Please enter your prayer request below.</h3>
    <Form method="post" action="mailto:support@crosspoint.org" enctype="text/plain">
    Type your prayer here:<br>
    <Textarea name="Pray for this:" Rows=20 cols=40></textarea>
    Your prayer needs are confidential, so you don’t need to give an e-mail address.<BR>
    But if you would like one of the pastors or other leaders to contact you, then please enter you e-mail below.<BR>
    <input type="text" name="E-mail:" Size="30">
    <input type="submit" value="SEND YOUR PRAYER"><input type="reset" value="RESET INFORMATION">

    So how come when you click submit it just goes to a regular mailto: command?... the website is here: www.crosspoint.org/Prayer.html

  2. #2
    Join Date
    Nov 2002
    Baltimore, Maryland
    <Form method="post" action="mailto:support@crosspoint.org" enctype="text/plain">

    What is it that you want this form to do?
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Nov 2002
    It's going to the mailto: command becasue that's what you are telling it to do in your code. <Form method="post" action="mailto:support@crosspoint.org" enctype="text/plain">

    What server side code are you allowed to use? Here's what I have for my site, but it uses PHP. If you can't use PHP then ignore this part.

    Here's my form...

    <form method="post" action="confirm.php">
    <div><input type="text" name="Name" /></div>
    <div><sup class="req">*</sup>E-mail:</div>
    <div><input type="text" name="EMail" /></div>
    <div><textarea cols="50" rows="5" name="Comments"> </textarea></div>
    <input type="submit" value="Submit" />
    <input type="reset" value="Reset" />

    Here's the PHP on my confirm.php page...

    <!-- Begin edit here -->
    header("Refresh: 3; URL=/index.html");
    echo " "; // NN4 requires that we output something...
    $msg = "Email from your website.\n";
    $msg .= "From: $Name \n";
    $msg .= "E-Mail: $EMail \n";
    $msg .= "$Comments";
    $email_to = "me@matts-website.net";
    $frome = "From: $EMail";
    $subject_line = "Matt's Website e-mail.";
    $Name = trim($Name);
    echo "Your email has been sent to me and I will read it as soon as possible.";
    <!-- End edit here -->

    I also added this <meta> tag in my confirm.php page to refresh the page to my home page.

    <meta http-equiv="refresh" content="5; url=index.html">

    Hmm, I already have a refresh in my header info. I'll have to play around with this to make it correct, but it still should work.
    Last edited by spufi; 06-27-2003 at 01:33 AM.

  4. #4
    Join Date
    Dec 2002
    High on life
    If I may make a suggestion about your PHP code, I would say that you should program assuming global variables are off, as they now are as a default since PHP 4.2.0 (though many hosts manually turn them on). So, this line:
    $msg .= "From: $Name \n";
    should be:
    $msg .= "From: $_POST["Name"]\n";

    and the rest would be along those same lines.

  5. #5
    Join Date
    Nov 2002
    Well that's what I fet for taking code from somebody else. I'll rework the code later on today. Thanks.

  6. #6
    Join Date
    Dec 2002
    High on life

    While you are switching, you may just want to use a loop to loop through all the $_POST vars. That way, if you ever use a form with more than message files, it won't be a problem. Something like this one here: http://forums.webdeveloper.com/showt...9543#post48748

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles