473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Asp Help Please

Hi Again!

So really simple problem this time. I use server 2003 and IIS for my website. I want to put in some simple ASP code to display stuff but when i enter it into the html page and view it, i just see the code i entered in text forum. Yes ASP is enabled in IIS. From what i understand from tutorials, i can enter this code directly into html files. Guess not. I know this works fine if i name the page whatever.asp, but its not all ASP, its mostly an html page. Heres an example of what im trying to do:

<html>
<body>
Your IP address is: <%Response.Write(Request.ServerVariables("remote_a ddr"))%>
</body>
</html>

But all i see is essentailly the same thing when i browse the page:

Your IP address is: <%Response.Write(Request.ServerVariables("remote_a ddr"))%>

Please Help

Regards,
Drew
Mar 30 '07 #1
8 2289
Hi Again!

So really simple problem this time. I use server 2003 and IIS for my website. I want to put in some simple ASP code to display stuff but when i enter it into the html page and view it, i just see the code i entered in text forum. Yes ASP is enabled in IIS. From what i understand from tutorials, i can enter this code directly into html files. Guess not. I know this works fine if i name the page whatever.asp, but its not all ASP, its mostly an html page. Heres an example of what im trying to do:

<html>
<body>
Your IP address is: <%Response.Write(Request.ServerVariables("remote_a ddr"))%>
</body>
</html>

But all i see is essentailly the same thing when i browse the page:

Your IP address is: <%Response.Write(Request.ServerVariables("remote_a ddr"))%>

Please Help

Regards,
Drew
What's the filename of the page you're loading into the browser that has the above code in it?
Mar 30 '07 #2
downloads.html
Mar 30 '07 #3
downloads.html
Rename the file to downloads.asp
Mar 30 '07 #4
Now i get this error, which is html related because i did a test page and it worked fine.

Active Server Pages error 'ASP 0127'

Missing close of HTML comment

/downloads.asp, line 71

The HTML comment or server-side include lacks the close tag (-->).

heres the page (I know the codes gross... :( dont scold me)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.amrscc.com">
<html>
<embed src="Music/Creations.mp3" hidden="true" autostart="true" volume="20" loop="true" mastersound></embed>
<link REL="SHORTCUT ICON" HREF="Misc/AMRSCC.ico">
<head>
<title>WWW.AMRSCC.COM</title>
</head>
<body bgcolor="black" link="green" alink="white" vlink="green">
<table width="982" height="100" border="2" cellpadding="0" cellspacing="5">
<tr bgcolor="blue">
<td height="100" colspan="0" >
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="968" height="150" id="Header" align="">
<param name=movie value="Misc/Header.swf"><param name=quality value=high>
<embed src="Misc/Header.swf" quality=high width="968" height="150" name="Header" align=""
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed></object>
</td>
</tr>
<table>
<br>
<table width="984" height="570" border="1" cellpadding="10" cellspacing="5">
<tr>
<th width="100" align="center" valign="top" scope="row">
<hr>
<br>
<a href="http://www.amrscc.com/">
<font color="white">
Home<br>
</font>
</a>
<br>
<a href="http://www.amrscc.com/friends.html">
<font color="white">
Friends<br>
</font>
</a>
<br>
<a href="http://www.amrscc.com/pictures.html">
<font color="white">
Pictures<br>
</font>
</a>
<br>
<a href="http://www.amrscc.com/downloads.html">
<font color="white">
Downloads<br>
</font>
</a>
<br>
<a href="http://www.amrscc.com/contacts.html">
<font color="white">
Contacts<br>
</font>
</a>
<br>
<a href="http://www.amrscc.com/about.html">
<font color="white">
About<br>
</font>
</a>
<br>
<hr>
</th>
<td width="825" align="left" valign="top" bgcolor="white">
<!-- START CONTENT --!>
<p>
<b>Your IP address is:</b>
<%Response.Write(Request.ServerVariables("remote_a ddr"))%>
</p>
<!-- END CONTENT --!>
</td>
</table>
</body>
</html>
Mar 30 '07 #5
I figured it out! YAY, but is there any way i can in a sense include ASP code into an html file and still have the file extension .html?
Mar 30 '07 #6
Thanks Merseyside for all your help. If you get a chance, check out my other question and see if you can help me there too http://www.thescripts.com/forum/showthread.php?p=2472886#post2472886

Thanks
Mar 30 '07 #7
jhardman
3,406 Expert 2GB
I figured it out! YAY, but is there any way i can in a sense include ASP code into an html file and still have the file extension .html?
Some servers can be configured to interpret scripts on HTML pages, I know apache can, I'm not sure about IIS. The big drawback is that will make the server check for scripts in ALL HTML pages, which will slow it down significantly.

Another option is to use server-side includes, this will allow a section of a given page to come from another page. The default extension for a page with includes is .shtml, but you can also configure your server to check for includes on other pages.

Jared
Mar 30 '07 #8
javakid
23
R u sure that u r running the file on a server and not directly opening in a browser ?
Bcoz .asp file will need to run through server other wise it will take the asp code as
text foe html file.

B sure to run this on the server It may be IIS on your PC.

Best regards

Javakid
Apr 4 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this...
1
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.