Skip to main content
Participating Frequently
May 9, 2006
Question

Script problem

  • May 9, 2006
  • 3 replies
  • 483 views
Whenever I try to execute an asp page it displays the actual code or at best html and empty strings as in...

Hello <%=strName> !

displays...

Hello !

Any ideas???
This topic has been closed for replies.

3 replies

Inspiring
May 10, 2006
The obvious one is that the page is saved with an extension other than .asp.
If that is not the case then the second option is that you server doesn't
support asp.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"LeeMc" <webforumsuser@macromedia.com> wrote in message
news:e3r1n7$art$1@forums.macromedia.com...
> Whenever I try to execute an asp page it displays the actual code or at
> best html and empty strings as in...
>
> Hello <%=strName> !
>
> displays...
>
> Hello !
>
> Any ideas???


LeeMcAuthor
Participating Frequently
May 10, 2006
Hi Paul,

I funny thing is that my server did crunch code a few months ago...just recently when I try to run pages that worked before my machine is displaying the code or empty stuff like the above?!?!?!
Inspiring
May 10, 2006
LeeMc

How are you populating the strName variable?

Brendan
______________________________________________
Rate your experiences with your UK and Ireland builders at
http://www.ratethebuilder.co.uk
=========================================


"LeeMc" <webforumsuser@macromedia.com> wrote in message
news:e3r1n7$art$1@forums.macromedia.com...
> Whenever I try to execute an asp page it displays the actual code or at
best html and empty strings as in...
>
> Hello <%=strName> !
>
> displays...
>
> Hello !
>
> Any ideas???


LeeMcAuthor
Participating Frequently
May 10, 2006
I wrote this form just to test again...Please check!

<HTML>
<BODY>

<B>Please enter your name and hobby:</B><BR>

<FORM METHOD=POST ACTION="namehobby.asp">
Your name: <INPUT TYPE=TEXT NAME=Name>
<BR>

Your hobby: <INPUT TYPE=TEXT NAME=Hobby>
<P>
<INPUT TYPE=SUBMIT VALUE="Submit!"
</FORM>
</BODY>
</HTML>

Here's namehobby.asp...

<%@ Language=VBScript %>
<% Option Explicit %>
<%

'Declare and set form variables
Dim strName, strHobby
strName = Request.Form("Name")
strHobby = Request.Form("Hobby")

%>
<HTML>
<BODY>

Hello <%=strName%> <BR>
Your Favorite hobby is <%=strHobby%>

</BODY>
</HTML>

This is what the browser displays...

Hello
Your Favorite hobby is
Inspiring
May 10, 2006
Is strName empty? Pop in a second % symbol before the closing >

Hello <%=strName%> !

Just in case it's a bigger problem like server issues, the following should
return hello. If not, there's something seriously wrong.

Hello <%
strName = "there"
Response.Write strName
%>

HTH,
Piers