Insert A Variable Value In An INCLUDE Fiel
Any ideas how to make the 'htm1.asp' a variable name?
Say at one time we want to use 'htm1.asp' and another
time we want to use 'htm2.asp' as the include file.
Any ideas?
Any ideas how to make the 'htm1.asp' a variable name?
Say at one time we want to use 'htm1.asp' and another
time we want to use 'htm2.asp' as the include file.
Any ideas?
is there a way of having a file that's name is a variable (eg dependant on the user name) act like a include. i know that you cant define the file for an include asp tag using a variable and that reading the file using "Response.Write FSO.OpenTextFile(ppp, 1, False, False).readall" prints the file, and treating it like a html file.
View Replies View RelatedI'm trying to include a variable in the <!--#include file='db.asp'--> stament?
View Replies View RelatedIt is possible to add variable into the include file.
<!--#include file="../info/<%=strfoldername%>/notetosomeone.asp"-->
strfoldername is from my database. It doesn't work. Anyone knows how to solve this problem. Or has other way to do it.
is it in any way possible to include a file specified by a variable name?
View Replies View RelatedI am trying to write a little script using includes ... but I am getting errors, I am passing a URL variable to use an include.
<!--#INCLUDE VIRTUAL=Request.QueryString("path")-->
Am I missing something?
im trying to make a string and in that string have an include in to include a .asp page is this possible. Code:
myhtml = ""
myhtml = myhtml & "This Should Work "
myhtml = myhtml & " <!--#include file ="TESTR.asp"--> "
Is it possible to pass a variable into an include statement?
I have a link as follows:
http://mywebsite/page.asp?project=tsc
My page.asp has three include statements.
<!--#include virtual="/nav_table.asp"-->
<!--#include virtual="/directory/project.asp"-->
<!--#include virtual="/menu.asp"-->
I'm hoping to replace "directory" with the variable in the link so that I get:
<!--#include virtual="/tsc/project.asp"-->
How does one get the variable in to the line above?
i'm trying to change the following include statement :
<div id="contents">
<!-- #include file="includes/main_page.asp" -->
</div>
on an ASP page into something that receives the file name as a variable :
<div id="contents">
<!-- #include file="<%=fileToInclude%>" -->
</div>
however, this doesn't seem to work, as i get the following error message :
The include file '<%=fileToInclude%>' was not found.
it obviously is trying to find a file named <%=fileToInclude%> instead of seeing the variable my question is : is it possible to feed a variable into an include statement ?
if yes, how should i go about it ? if not, are there any alternatives ?
activelang=Request.QueryString("lang")
.
some code
.
Response.Write " <!--#include virtual='/SIFS/" & activelang & "/welcome.txt' -->"
activelang=Request.QueryString("lang")
.
some code
.
<!--#include virtual='/SIFS/<%= activelang %>/welcome.txt' -->
Is there any trick will do the job ?
how to assign a variable in a page then in a file that is included write a variable to an include virtual statement that's located in the 2nd included file? I've tried this but it doesn't work Code:
View Replies View RelatedI have a feeling someone can answer this very quickly, but Im having problems. Basically Im trying to get the rate variable which will be either a 0 - 10 inserted into the appropriate row. I want the variable filename to match up with the matching filename in the database and then insert the rate variable into that filenames rate column. Hope I didnt confuse you to much.. Code:
View Replies View RelatedI just can't seem to figure out this problem Here's the code:
minv = request.form("min")
maxv = request.form("max")
price = request.form("price")
Response.write(minv &" "& maxv &" "& price)
sSQK = "INSERT INTO tbl_weight (min, max, price) Values (" & minv &","& maxv &",'"& price &"')"
conn.Execute(sSQK)
Response.write("Gegevens toegevoegd!")
But it just keeps givving me an error
"Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement. "
I think it has to do something with the "minv" and "maxv" those two are numbers and if I remove them the INSERT command goes fine... but what am I doing wrong ?
I've been browsing this and a few other related newsgroups trying to get my head around this problem, and so far all the trails seem to go cold, without an acceptable solution being reached. I'm posting here because there seems to be a few MVP's knocking around, and if they dont know, then it's a safe bet nobody does.
I'm beginning to think that what I want to do is simply not possible - but i'll put it out there once more.
Here goes: I'm writing a content managaement system - and i'm making use of dynamic includes via the "read a text file" technique, and then substitiuting values into markers in the template. Code:
first I typed this:
p=Request.QueryString("num")
then I typed this:
sqlstring = "select column1 from table where column2 like '%p%'"
it find nothing. anyway, if I replace the "p" in the second line to what it was equal, it does find what I need.
moreover, when I print "p" I get the right string.
How to prevent duplicate values when using BULK INSERT to insert CSV to SQL Server? Code:
View Replies View RelatedI want to be to call my menu from another file onto my page so that i dont have to add it to every page of my website. The problem is when i try to add it using the include method it says that only one include file is allowed on an ASP. The other include file is my connection string so i cant really take that out of the page because then nothing else will work!
How can i get the menu page included as well as the connecting string?
Have added the code below, i have highlighted the 2 include files that i want to use in blue, i have also left the div tag in for where i currently have the menu which is what i want to take out and have ther include file there instead, if that makes sense. Basically the bit in red i want to be able to remove from all of my pages and add the blue file above the red code in instead, but i dont know how!!!!! Code:
I'm turning my application into a "DLL". Everything worked fine untill I try to do a "While" in my asp code. Then I recieve an error like this:
"Object variable or With block variable not set"
My vb code look like this.....
is there any way of passing a javascript variable over to a asp variable so
i can write it to my database.
How do I convert an ASP variable to a Javascript variable?
View Replies View Relatedsql = "SELECT * FROM & console &'news'"
I got that right now but i want the variable, console to be placed along with news so when it selects from the db it selects from gcnnews or whatever variable it's on. How do I do that?
im trying to subtart one quantity from another then stick the answer in to an update statment, but all i get is an error in syntax message
variable math bit=
qty=request.form("oqty")-Request.form("qty")
sql =
sSQL="Update spares SET spares.location='"&request("location")&_
"',spares.machine='"&request("machine")&_
"',spares.part_desc='"&request("part_desc")&_
"',spares.part_number='"&request("part_number")&_
"',spares.qty='(" & qty & ") "&_
"',spares.min_qty='"&request("min_qty")&_
"',spares.updated_by='"&session("name")&"' WHERE(spares.id)=" & form_id
I need to assign a value to a variable, but this variable name is dependant upon another variable!! I am including the code below so you can see it, cos if not I am sure you are thinking whattt?? Code:
View Replies View RelatedHow i can do <!--#include file="filename"--> dynamic with ASP, or any other way
View Replies View RelatedIf I want to include a file to my webpage that is not placed in the same
folder asd the application, but in another folder on the same disk...
I found out that this is not going to work:
<!--#include virtual="D:/binaer.no/nova/test.asp"-->
Is there any other way to include from another domain account on the same
server?
There is going to be several applications that includes the same file, so
the trix ../../../ will not do it for me...
<%
I am trying to use "set con" in the include file. i used it before with simple text but when I use the connection object it doesn t work. is this possible in asp and what is the problem with the code below:
inc.asp file
VARMSG = "set con = Server.CreateObject("ADODB.connection")"
con.Open ("dsn=project;uid=sa;pwd=sa")
%>
mainpage.asp
<!-- #include file="inc.asp" -->
<%
Response.write
set rsTypes = con.execute("select * from firstmarch order by cat")
%>
Can someone advise how can I send an html message that include gif file using cdonts.
the gif cannot link to www, or any specific server location. user must be able to view when they open their email.no as attachment.
I have asp page file0.asp which calls another asp page thru include. I have to set conditions tht....
originally the include should have file1.asp In the displayed file file1.asp user selects a hyperlink, it should take it as request and display the new file2.asp in same file0.asp in place of file1.asp.
so i want to display multiple pages on user request inside file0.asp. But originally when file0.asp loads it should have file1.asp. Code:
how to include an asp file into an other asp file with checking condition first.I can do this easily in PHP, but in ASP, it seem that the content of included file is process before it read the code on page.So when I include a asp page into another asp page, I cannot choose which page will be include base on the condition.
View Replies View Relatedmake a script for my forums (the header) involving the date and an included page. Quote:
If the month is 9 (September) then include page x
elseif the month is 10 (October) then include page y
else include page z
How do I go about doing that? I know how to do it in php, but I'm looking to do it with asp.
I m trying to test an include example using the code below, but the page "aspsrc.asp" cannot be displayed.
--->aspsrc.inc page
<%
var msg = "testing testing"
%>
-->inc.asp page
<!-- include statement not to be placed within ASP delimiters -->
<!-- #include file=".aspsrc.inc" -->
<%
Response.Write( msg );
%>
When I first started using Server Side Includes I used the regular file include:
Code:
<!--#include file = "myfile.asp"-->
Then I read where the virtual include is much beter. I figured I would try it out, so on my last project I used all virtual includes:
Code:
<!--#include virtual = "/somedirectory/somefile.asp"-->
It worked fine and I really couldn't tell any differnce. Maybe a little easier to remember where all the file needed to point to. But this was for a New Site so testing it on the server was easy. I didn't have to worry about existing content up there.
I'm now redesigning a site to add in some dynamic stuff and I always test everything on the server it will reside on to be sure everything will work. Typically I create a "v2" directory and run everything from there. Well this really screws me up when using a virtual include, becuase I would have to edit and then rededit all my file paths.
So my question is... What do you use? And why are file includes so bad?
i'm calling an include file from within a <td> tag of an existing include file (i'm calling the adroator component from the head.asp file.
i'm getting the following error
Error Type:
MSWC.Adrotator (0x80004005)
ERROR Cannot load rotation schedule file
/root/includes/adrotator/adrotatorhomepage.asp, line 14
the include file head.asp is located in the includes directory while the ssi its calling is on the adrotator directory. here is the code for the adrotatorhomepage.asp (all relevant files are in the same directory) Code: