• 0

Creating an HTML Contact Form


Question

Hi everyone. I don't work in HTML very often at all, but I am working on a simple website presently and wanted to add a contact form, but our hosting is Windows, so php is not an option. So I was wondering if I was able to create a simple contact page in html. I've never attempted to do so before, and after searching online didn't find a way that this has been accomplished, so I wanted to ask on here.

So, what suggestions would those that are much more familiar with HTML than I have? Any help is greatly appreciated.

Thanks Again,

Link to comment
https://www.neowin.net/forum/topic/1133986-creating-an-html-contact-form/
Share on other sites

8 answers to this question

Recommended Posts

  • 0

there's no excuse to rely on the client to handle forms in this day and age. write a mailing script in whatever language your host does support.

Thanks everyone for your responses. I have windows hosting, so I could write something in C# as an example (That's what I use for desktop development).

I guess my question though would be how to do that... I know it's broad, but I've never done anything like that. Would I create the UI in the HTML document and then on Send button click somehow use the C# code? I'm very intrigued by your post, but I honestly don't understand how this would be accomplished. Like I said, I very infrequently do web work, so while sending an e-mail is no problem on the desktop, I am unsure of how to do that through an HTML page.

Thanks Again everyone for your help.

  • 0

Thanks everyone for your responses. I have windows hosting, so I could write something in C# as an example (That's what I use for desktop development).

I guess my question though would be how to do that... I know it's broad, but I've never done anything like that. Would I create the UI in the HTML document and then on Send button click somehow use the C# code? I'm very intrigued by your post, but I honestly don't understand how this would be accomplished. Like I said, I very infrequently do web work, so while sending an e-mail is no problem on the desktop, I am unsure of how to do that through an HTML page.

Thanks Again everyone for your help.

you'd do exactly the same as you would a PHP-based form. Have the HTML form POST to the server side script, and figure out how to read that POSTed data in the language of your choosing and process it from there.

  • 0

you'd do exactly the same as you would a PHP-based form. Have the HTML form POST to the server side script, and figure out how to read that POSTed data in the language of your choosing and process it from there.

Thanks everyone for all of your help. I think I'm definitely on the right track (I actually wasn't aware of POST). I've never done anything like this before, just basic html pages...

Here's what I have. I found an online tool that generates this, which I thought was pretty handy.

html:

<!-- Website Contact Form Generator -->

<!-- http://www.tele-pro.co.uk/scripts/contact_form/ -->

<!-- This script is free to use as long as you -->

<!-- retain the credit link -->

<form method="POST" action="/cgi-bin/contact.cgi">

Fields marked (*) are required

<p>Email From:* <br>

<input type="text" name="EmailFrom">

<p>Subject: <br>

<input type="text" name="Subject">

<p>Name:<br>

<input type="text" name="Name">

<p>Tel:<br>

<input type="text" name="Tel">

<p><input type="submit" name="submit" value="Submit">

</form>

<p>

<!-- Contact Form credit link -->

Created by <a target="_blank"

href="http://www.tele-pro.co.uk/scripts/contact_form/">Contact

Form Generator</a>

CGI (I changed the email address for this post only):

#!/usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);

use CGI qw(:standard);

print "Content-type: text/html \n\n";

# Website Contact Form Generator

# http://www.tele-pro.co.uk/scripts/contact_form/

# This script is free to use as long as you

# retain the credit link

# get posted data into local variables

$input = new CGI;

$EmailFrom = $input->param('EmailFrom');

$EmailTo = "email\@mysite.com";

$Subject = $input->param('Subject');

$Name = $input->param('Name');

$Tel = $input->param('Tel');

# validation

$validationOK=true;

if ($EmailFrom eq '') {$validationOK=false;}

if ($validationOK eq false) {

print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";

exit;

}

# prepare email body text

$Body .= "Name: ";

$Body .= "$Name";

$Body .= "\n";

$Body .= "Tel: ";

$Body .= "$Tel";

$Body .= "\n";

# send email

use Win32::OLE;

$ex = Win32::OLE->new('CDONTS.NewMail') or die "\nCDONTS error";

$ex->Send($EmailFrom,$EmailTo,$Subject,$Body);

# redirect to success page

print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";

But the error I get is:

HTTP Error 404.0 - Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Which, O.K., that's no big deal, the post action is directing it to a file that's not there. But I've creating the cgi-bin directory, I've stuck the file in there, I've changed the path to another directory where I put the file. No matter what I do it can't find this file. So, I was wondering if anyone sees something that I'm missing... I figured this would work if the file was where it should be... ?

Thanks Again for all of the help. I really appreciate it.

This topic is now closed to further replies.
  • Posts

    • My father still uses a programme written in dbase3. Still manages to work with a little help from dosbox. 
    • Microsoft hides these secret Windows 11 performance boost settings available on every PC by Sayan Sen Windows enthusiasts often look for ways to extract as much performance out of their systems as possible, and it's often the case that they try and do so while trying to minimize the heat and power consumption. This is especially relevant in the case of mobile Windows PCs since laptops and notebooks tend to get hot and management of that heat and power is harder in such a form factor. As such users often turn to techniques like under-volting which can be used to squeeze out the maximum capabilities of a chip while also maintaining lowered power levels. There are official apps from AMD and Intel with the likes of Ryzen Master and XTU (Extreme Tuning Utility). While these are quite handy, most enthusiasts probably prefer to dig into the BIOS and play around with settings there like Curve Optimizer on Ryzen, which lets users set various frequency-voltage scaling values. These are essentially called P-States. If you are not familiar with them, Processor Power Management is done through Advanced Configuration and Power Interface (ACPI) P-states and C-states. While P-states or performance pwoer states handle CPU voltage-frequency scaling, C-states deal with CPU sleep states so that some of the CPU functions, which are not necessary at that moment, can be disabled. The P-states and C-states work together to make the processor run more efficiently. It helps the OS and apps determine which cores can be parked and which should be boosted. Of course not every user is an enthusiast or knows the technicalities and integrities of how things like overclocking or undervolting work. Thankfully for them Windows itself offers something pretty cool, though it is hidden by default on all systems. By default, Windows only has two P-States, "Minimum Processor State" and "Maximum Processor State." However, this can be changed with a Registry trick to expand the options under a secret "Processor performance boost mode" dropdown. This essentially enables the HWP or hardware P-States available on a device, and these are not controlled just by the OS itself as the underlying hardware gets involved too. In total there are five Processor Performance Boost Mode profiles that control how Windows requests and allows CPU turbo/boost behavior under the different power policies. They are: Disabled: In this mode, processor boosting is effectively turned off. The CPU will avoid entering turbo or boost frequencies and instead operate closer to its base frequency ceiling. This can significantly reduce power consumption and heat output, but at the cost of reduced burst performance and responsiveness in short workloads. Enabled: This is the standard behavior where boost functionality is allowed under normal conditions. The processor can opportunistically increase frequency when workload demands it, balancing performance gains with power and thermal constraints as managed by the system. Aggressive: Aggressive mode favors performance more heavily, allowing the CPU to enter higher boost states more readily and sustain them longer. This should in theory improve responsiveness under bursty or heavy workloads but increases power draw and thermal output compared to the default enabled behavior. Efficient Enabled: This mode still allows boosting, but with a stronger bias toward energy efficiency. The system attempts to use boost more selectively, avoiding unnecessary frequency spikes when the performance gain is marginal. Efficient Aggressive: This is a hybrid approach where boost is still performance-responsive, but the system continuously weighs efficiency more heavily than in Aggressive mode. It aims to deliver noticeable performance improvements while reducing wasted power in less demanding scenarios. Here's how to enable the Processor performance boost mode: Open Registry Editor: Press Win+R, type regedit, and click OK. Go to: HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\be337238-0d82-4146-a960-4f3749d470c7 (where HKLM stands for HKEY_LOCAL_MACHINE_) Modify the value of Attributes from 1 to 2 (you can find modify option by right-clicking) After that, exit Registry, you should now be able to see the new "Processor performance boost mode" dropdown menu: As you can see there are now five new P-States or CPPC states or power profile available that help define the boost mode processor setting on your PC. Wrapping it up here's a quick run-down of the settings as defined by Microsoft itself. Setting Description Disabled The corresponding P-state-based behaviour is disabled. Collaborative Processor Performance Control (CPPC) behaviour is disabled. Enabled The corresponding P-state-based behaviour is enabled. CPPC behaviour is Efficient Enabled. Aggressive The corresponding P-state-based behaviour is enabled. CPPC behaviour is Aggressive. Efficient Enabled The corresponding P-state-based behaviour is Efficient. CPPC behaviour is Efficient Enabled. Efficient Aggressive The corresponding P-state-based behaviour is Efficient. CPPC behaviour is Aggressive. Aggressive At Guaranteed Windows calculates the desired extra performance above the guaranteed performance level, and asks the processor to deliver that specific performance level. Efficient Aggressive At Guaranteed Windows always asks the processor to deliver the highest possible performance above the guaranteed performance level. In the next part we shall be comparing these settings to explore how much of a benefit or regression they can provide in terms of performance and power efficiency. If you decide to change the values on your system and are experiencing problems like crashes or an overheating PC, make sure to revert the steps back to the original state.
    • I think he means you haven't reviewed previous UFC games. Of course it doesn't matter... Every time you just report on something that involves the President even if just simply what happened you guys usually get accused of being anti-Trump. We live in fun times.
  • Recent Achievements

    • One Month Later
      Leroy Jethro Gibbs earned a badge
      One Month Later
    • Conversation Starter
      flexorcist earned a badge
      Conversation Starter
    • One Month Later
      AndreaB earned a badge
      One Month Later
    • One Month Later
      agatameier earned a badge
      One Month Later
    • Week One Done
      agatameier earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      518
    2. 2
      +Edouard
      198
    3. 3
      PsYcHoKiLLa
      147
    4. 4
      ATLien_0
      93
    5. 5
      Steven P.
      77
  • Tell a friend

    Love Neowin? Tell a friend!