We have a web site that is mostly static but has some flash stuff so there are some .asp pages but they aren't really doing anything dynamic. Now I'm trying to add a form to be submitted to an employee's email but all the code I'm trying just doesn't work. I've tried 4 different tutorials/walkthroughs explaining how to submit a form to an email address and none of the code works.
So I took a small piece of code and put it in my page and I kept getting errors referring to the syntax and one by one I adapted the code to the point that I could get the page to display with no errors.
Here is the code I tried to use:
// has the form been submitted?
if ( bSubmitted )
// get the data from the form...
sEmail = '' + Request.Form ( "email" );
// validate the email address and moan if it fails
if ( sEmail != '' && !IsValidEmail ( sEmail, hexVeLevelDns ) )
// pretend the form hasn't been sent yet
bSubmitted = false;
Here is the code after modification that would allow the webpage finally display:
' has the form been submitted?
if ( bSubmitted ) Then
' get the data from the form...
sEmail = "" + Request.Form ( "email" )
' validate the email address and moan if it fails
if ( sEmail = "" ) then
' pretend the form hasn't been sent yet
bSubmitted = false
Is my page using an old version of .asp? It is an old site but I got some code to return the ip address of the user and that worked
UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserIPAddress = "" Then
UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
so I'm just confused as to what's going on with this page. Is it not asp? Is it maybe vb? It's been a few years since I've coded. Maybe it's C#?
Any help figuring out what's going on would be greatly appreciated!!