Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Best way to send this form?

    Hey people well yesterday i posted in the php section with a pre made form but now ive found another one that does the job i want better but it's only in javascript and html anyway here is the page linky

    Now what i want is to send the results to my email address but what language would be best and how would i do it? I though php would be best but... i really dont understand it lol anyway here is the code so far:

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <
    html xmlns="http://www.w3.org/1999/xhtml">
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <
    title>.:Liam Sidley Student Site:.</title>
    <
    link rel="stylesheet" media="screen" href="style.css" type="text/css" />
    <
    SCRIPT TYPE="text/javascript" src=formval.js>
    </script>
    </head>
    <div id="whole">
      <div id="banner"></div>
      <div id="navigation"><a href="index.html" title="Home" target="_self">Home</a> | <a href="about.html" title="About Me" target="_self">About Me</a> | <a href="work.html" title="Work" target="_self">Work</a> | <a href="links.html" title="Links" target="_self">Links</a> | <a href="portfolio.html" title="Portfolio" target="_self">Portfolio</a> </div>

      <div id="h2">
        <h2>Home</h2>
    </div>
      <div id="content">
    <SCRIPT TYPE="text/javascript">
    // Only script specific to this form goes here.
    // General-purpose routines are in a separate file.
      function validateOnSubmit() {
        var elem;
        var errs=0;
        // execute all element validations in reverse order, so focus gets
        // set to the first one in error.
        if (!validateEmail  (document.forms.demo.email, 'inf_email', true)) errs += 1; 
        if (!validatePresent(document.forms.demo.from,  'inf_from'))        errs += 1; 

        if (errs>1)  alert('There are fields which need correction before sending');
        if (errs==1) alert('There is a field which needs correction before sending');

        return (errs==0);
      };
    </SCRIPT>


    <FORM NAME=demo onsubmit="return validateOnSubmit()" action="thanks.html">
    <TABLE CLASS=formtab SUMMARY="Demonstration form">
      <TR>

        <TD STYLE="width: 10em">
            <LABEL FOR=from>Your name:</LABEL></TD>
        <TD><INPUT TYPE=text NAME="from" ID="from" SIZE="35" MAXLENGTH="50" 
             ONCHANGE="validatePresent(this, 'inf_from');"></TD>

        <TD id="inf_from">Required</TD>
      </TR>

      <TR>
        <TD><LABEL FOR=email>Your e-mail address:</LABEL></TD>

        <TD><INPUT TYPE=text NAME="email" ID="email" SIZE="35" MAXLENGTH="50" 
             ONCHANGE="validateEmail(this, 'inf_email', true);"></TD>
        <TD id="inf_email">Required</TD>
      </TR>

          <tr> 
          <td><label for=subjet>Subject:</label></td>
          <td><INPUT TYPE=text NAME="subject" ID="subject" SIZE="35" MAXLENGTH="50"></td>
          <td>&nbsp;</td>
        </tr>

        <tr> 
          <td><label for=message>Message:</label></td>
          <td><textarea name="message" cols="55" rows="10" wrap="OFF" class="box" id="message"></textarea></td>

          <TD>&nbsp;</TD>
        </tr>

      <TR>
        <TD>&nbsp;</TD>

        <TD><INPUT TYPE="Submit" NAME="Submit" VALUE="Send"></TD>

        <TD>&nbsp;</TD>
      </TR>

    </TABLE>
    </FORM>
    <p>&nbsp;</p>
    <div id="copyright">&copy; <a href="mailto:sr910424@staffs.student.ac.uk?Subject=Student Site">Liam Sidley</a> - Staffordshire University Student</div>
    <p>&nbsp;</p>

    </body>
    </html> 

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    If you are able to use php, then I would suggest php. If you don't understand it then learn it. Other server side languages will be hard for you to understand as well since many programming languages have very similar syntax.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok thanks, what way would be best? a seperate php file saying collect the info from that and send it to me or putting all i have there in the same file and then sending? sorry for sounding dumb

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Put the php in the same php file and have the server submit to the same php file.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Nov 2005
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok thanks mate


  •  

    Posting Permissions

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