Solved

Use f.writeline to make an asp site

Posted on 2008-10-01
7
297 Views
Last Modified: 2012-08-14
Hi There.

I need to make an asp file with f.writeline but it dosent seem to work.

f.writeline("<%SiteName= "tilbudsaviser"")
f.writeline("<script language="JavaScript">")
f.writeline("<!-- #INCLUDE file="../includes/top.asp" -->")

Can i use an other method?

0
Comment
Question by:bongii
  • 3
  • 3
7 Comments
 
LVL 7

Expert Comment

by:Norush
ID: 22612481
This is not a good way to format a question?
Please supply us with more information?

What is f  ?
Do you want to create an ASP page from another language?
Do you get an error message ?
0
 

Author Comment

by:bongii
ID: 22612496
Well I think it´s pretty clear.
I want to make a .asp file from classic .asp and gets an error:

Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateTextFile(Server.Mappath("test.asp"))
filespec = Server.Mappath("test.asp")
Set f = fso.OpenTextFile(filespec,2)
f.writeline "<%response.write "test"%>

f.writeline "<%response.write "test"%> makes error.
0
 
LVL 2

Assisted Solution

by:devshb
devshb earned 20 total points
ID: 22612521
In your example above, you've got a double-quote inside the line with the javascript include; that'll produce an error because it's treating the double-quote as an end of the whole text string, so replace the relevant double-quotes with 2 double-quotes, as per the attached example

or, alternatively, you can use chr(34), as per the second chunk of code, where ampersand is the asp character which joins/concatenates text strings together
f.writeline("<%SiteName= ""tilbudsaviser""")

f.writeline("<script language=""JavaScript"">")

f.writeline("<!-- #INCLUDE file=""../includes/top.asp"" -->")
 

or:
 

f.writeline("<%SiteName= "&chr(34)&"tilbudsaviser"&chr(34)&")"

f.writeline("<script language="&chr(34)&"JavaScript"&chr(34)&">")

f.writeline("<!-- #INCLUDE file="&chr(34)&"../includes/top.asp"&chr(34)&" -->")

Open in new window

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:bongii
ID: 22612630
But then i need %>

If i write f.writeline("<%SiteName= ""tilbudsaviser""%>"), it makes an error:
f.writeline("<%SiteName= ""tilbudsaviser""
------------------------------------------^
0
 
LVL 7

Expert Comment

by:Norush
ID: 22612667
If you write %> then your current asp-page sees that as the end of an asp statement.

You need to use escapechars for the % sign. So the first line would look like:

"<" & Chr(37) & "SiteName=""tilbudsaviser""" & Chr(37) & ">"
0
 
LVL 7

Accepted Solution

by:
Norush earned 30 total points
ID: 22612668
Here in a code snippet:
"<" & Chr(37) & "SiteName=""tilbudsaviser""" & Chr(37) & ">"

Open in new window

0
 

Author Comment

by:bongii
ID: 22612847
Perfect thanks
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now