HTML form with submit button (without PHP)

Hi,

I am currently using forms with PHP. However I am looking to change server from LINUX to Windows and PHP is not supported.

How do I design a HTML form without PHP?

I am currently using:

<form action="question-submitted.php" method="POST">

and then the details are sent to an email address on the question-submitted.php page. How to I submit the form details to my email address on the HTML form page instead of passing the information to the next page?

Kind regards,

Matt.

http://support.microsoft.com/kb/279460

I’d honestly just write it in some other language though (the e-mail script)

PHP can easily be added to Windows though, have you asked your host to install it for you?

There are plenty of Windows servers that support PHP and it is really not hard to install even if you use IIS. Just intalling the software (basically, copying files) and link it to your favourite web server (either add a few lines of code for Apache or use the control panel for IIS)

If you’re contratict a hosting service, I’d be surprised that they don’t support PHP in their Windows servers

Hi Ryan Reese,

I have tried your form idea :

<FORM Action="mailto:site@site.com" METHOD="POST" ENCTYPE="text/plain">
	mailto: protocol test:
	<Br>Subject: 
	<INPUT name="Subject" value="Test Subject">
	<Br>Body:&#xa0;
	<TEXTAREA name="Body">
	kfdskfdksfkds
	</TEXTAREA>
	<BR>
	<INPUT type="submit" value="Submit"> 
</FORM> 

The problem is when you click submit it opens an email client to send the email. I need the form to automatically send the email and go to a confirmation web page.

Is this possible with plain HTML form coding?

Matt.

No, which is why I suggested writing it in another language. You need to interact with the server to send e-mails like that. HTML does not do that. Find a language that your host supports (it SHOULD be able to have PHP on it) and then find some random e-mail script and copy/paste it in (if you don’t feel like learning.)

Go daddy does not have PHP on their Windows Servers. My current hosting is Linux and that does but I am looking at using the VPASP.com cart which uses ASP pages so I need to change to Windows Server instead.

Matt.

I would wait slightly. Are you talking about .NET? .NET is coming to Linux very soon…perhaps @cpradio can give more information on that. I believe it was him who I read it from?

Either way, Godaddy can easily install PHP for you. Please open up a chat ticket and talk to them. PHP is probably not installed by default to ease up on disk space. They certainly can install it for you.

Yes, it is true that the next version of .NET is supposed to be able to run on Linux, however, it will be a LONG time coming before any existing applications will have “Linux” support, chances are, they’ll have to upgrade to the newest CLR and .NET runtimes and that’ll cost them money to do (they’ll do it eventually, but they won’t jump on it immediately).

@MatthewBOnline, yes you can run PHP on Windows. I’d definitely start with asking your host (if you wish to use PHP), otherwise, you’ll want to download Visual Studio Express if you want to build your own HTML website using .NET so you can have a contact form, and whatever else you may want.

@RyanReese, Linux has supported .NET (since it came out of the market. That includes ASP.
The problem with .NET programmers is that they use objects and dlls which only exist in Windows to do their sites.

@MatthewBOnline, I’m surprised that GoDaddy doesn’t support PHP in their Windows servers but, if they really don’t, well… it surprise me why they’re so popular. For similar cheap prices and more features, I would go for 1&1 (their windows servers do include PHP)

You can’t have a form with no backend programming (exception made of your method is mailto, as Ryan suggested but that’s insecure to no end and you’ll be risking yourself to receive thousands and millions of spam messages).

So either you choose another hosting (which I think it is a wise decision) or you use one of the built in scripts that every single hosting provider has for that very purpose and that, most of the time (and in every single company I hosted, it’s been like that) you will find under the cgi-bin folder.

Check the FAQs and manuals that I’m sure GoDaddy will have to get you started with your hosting

.NET and ASP are not the same :smile: ASP, probably is supported by Linux, but that isn’t anywhere close to being .NET (we’re talking apples to oranges here).

.NET to my knowledge (without using Mono) is not supported by Linux. So if the cart is written in ASP.NET, it can’t easily run on Linux (you’d have to try getting it to run using Mono, not an easy task).

Just wanted to point out the clarification :smile:

I have just found this:

http://www.tizag.com/aspTutorial/aspFormsEmail.php

Would this form do what I am looking for (on the Windows Servers using ASP)?

Matt.

Off Topic:

You may be right. It’s been ages since .NET framework came out.

I do seem to recall that when .it did, Microsoft Spain did a huge presentation where we were told that it would work under Linux as PHP was already working under Windows. Of course, at the time .NET and ASP were about the same, .NET was brand new.

The simplest scripts did work but anything beyond that was rubbish. Precisely because most of the scripts, at least at the time, came from third parties and dlls… and there were no equivalents in Linux. So the whole thing was a joke.

I always thought that Mono came to create the substitution of those basic objects and dlls that we all took for granted because they existed in Linux.

But, it was a long time ago, and you know that my memory is rubbish

1 Like

Yes, that is a verify simplified version of it and has one big mistake. It collects the From on the HTML form. Don’t do that. Hard code it in your email.asp logic. Otherwise, anyone can use your form to send emails to anyone.

1 Like

ok - also do you know how to pass a value to an ASP form?

In PHP you just write the URL as www.site.com/page.php?value=001

then you “echo” the “value” on the next page.

How do you do it with ASP pages?

Thanks,

Matt.

Similar. You can use mypage.asp?value=001 and in your ASP page you would use the Request.QueryString(‘value’)

You’ll want to validate it, obviously to make sure it contains a valid value or type of value (so you don’t get garbage data).

That’s Obviously, if you use the GET method which is more visible and less secure than a POST method (but, when you want people to see what they’re sending, like in a search query, it is still useful)

If you’re using a POST method, instead of Request.QueryString("name_of_variable'", you would use Request.form(“name_of_variable”)`

And if you want to display it on screen

<%
response.write(request.form("name of _variable"))
%>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.