Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with webpage form

Status
Not open for further replies.

Enkrypted

Technical User
Sep 18, 2002
663
US
Hey guys, I was wondering if any of you might be able to help me out. I am in a bit of a jam. We recently moved our webhosting provider from a Windows based system to a Linux based system. Everything works fine except I forgot about the contact submit form. That will not work because it is an ASP page. I need to find a way to convert it so it will work without having to redo the entire page.

Basically when you get to our contact page (which is html) and enter your info. You click on the submit button and it is supposed to e-mail us the info from the page and redirect to a thank you page.

The code for the ASP page (the background submit process) is in VBScript and is as follows:

<%@ Language=VBScript %>
<%


Dim MyBody
Dim MyBodyEnc
Dim MyBodyFinal
Dim MyCDONTSMail


MyBody = "On " & now & " someone sent an email from the Contact page. "
MyBody = MyBody & " The following information was sent." & Chr(13) & Chr(13)
For Each x In Request.Form
If Request.form(x) <> "submit" then
MyBody = MyBody & x & ": " & Request.Form(x) & Chr(13)
End If
next
response.Write(MyBody)
Dim sSubjectString
sSubjectString = "Contact Inquiry form"

SendEmail = 1
If SendEmail = 1 THEN
Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From= "no-reply@sharperimpressionspainting.com"
MyCDONTSMail.To= "sipainting@sharperimpressionspainting.com"
MyCDONTSMail.Bcc= "forefrontweb@gmail.com"
MyCDONTSMail.Subject= sSubjectString

MyCDONTSMail.Body = MyBody
MyCDONTSMail.Send
set MyCDONTSMail=nothing
End If

response.redirect("/thankyou.html")
%>

I was wondering if any of you guys might be able to help me convert it or find a solution to get this to work. I'm not real familiar with this at all and am in need of help in a big way. I appreciate any help. Thanks

Enkrypted
A+
 
I don't know of a way to convert, and since this is hosted, I'd doubt they have mono loaded (for .NET on Linux). I hate to say, but I'd rewrite in PHP.

The code will be somewhat similar...

<?php
$MyBody = $_POST['whatever_the_html_field_name_is'];
etc. for the other variables.

$rightnow = date("Y-m-d H:i:s");

$mail = new Mail;
$mail->Subject( "Enter Subject here");
$body = "Start body here";
$body .= "\n"."Place more body here";
$mail->From ( 'no-reply@sharperimpressionspainting.com' );
$mail->To( 'sipainting@sharperimpressionspainting.com', true );
$mail->Send();

?>
Finish off with a standard html redirect
<meta http-equiv="REFRESH" content="0;url=thankyou.html">

Check out the PHP forum if you need more help and decide to go this way.

Mark
 
As far as web scripting is concerned, you really should take this over to the PHP forum. We'll try and help you there.

--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top