logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 10-22-2009, 04:00 PM   #1
macsolutions
 
Join Date: May 2007
Posts: 38
Default

Hi, I have an HTML website on a MS Server with a PHP contact form, this is because I had to move this website from a Linux server as my other site is in ASP. The contact form does not work, as expected, and I would like to convert this over to ASP to make it work.

I have no knowledge what so ever in ASP and was hoping some kind soul could figure it out for me. I did convert it with an online converter but did not know how to save it as an ASP file.

html website: www.macsolutions.co.uk

CONVERTED PHP TO ASP FILE
<%
Dim gv_%>
?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Contact Form';

// Your email address. This is where the form information will be sent.
$emailadd = 'support@macsolutions.co.uk';

// Form Address.
$url = 'http://www.macsolutions.co.uk/contact us/contact us.html';

// Where to redirect after form is processed.
$url = 'http://www.macsolutions.co.uk/confirmation/confirmation.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?
%>


PHP FILE
?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Contact Form';

// Your email address. This is where the form information will be sent.
$emailadd = 'support@macsolutions.co.uk';

// Form Address.
$url = 'http://www.macsolutions.co.uk/contact us/contact us.html';

// Where to redirect after form is processed.
$url = 'http://www.macsolutions.co.uk/confirmation/confirmation.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

Many Thanks
Tom

Hi, I have an HTML website on a MS Server with a PHP contact form, this is because I had to move this website from a Linux server as my other site is in ASP. The contact form does not work, as expected, and I would like to convert this over to ASP to make it work.

I have no knowledge what so ever in ASP and was hoping some kind soul could figure it out for me. I did convert it with an online converter but did not know how to save it as an ASP file.

html website: www.macsolutions.co.uk

CONVERTED PHP TO ASP FILE
<%
Dim gv_%>
?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Contact Form';

// Your email address. This is where the form information will be sent.
$emailadd = 'support@macsolutions.co.uk';

// Form Address.
$url = 'http://www.macsolutions.co.uk/contact us/contact us.html';

// Where to redirect after form is processed.
$url = 'http://www.macsolutions.co.uk/confirmation/confirmation.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?
%>


PHP FILE
?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Contact Form';

// Your email address. This is where the form information will be sent.
$emailadd = 'support@macsolutions.co.uk';

// Form Address.
$url = 'http://www.macsolutions.co.uk/contact us/contact us.html';

// Where to redirect after form is processed.
$url = 'http://www.macsolutions.co.uk/confirmation/confirmation.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
macsolutions is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:07 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com