I have been avoiding this issue but it keeps popping up and I cannot figure out a solution. Include statements pathed two or more folders deep they break.
This works:
<!--#include file="../includes/mo_security.asp" -->
This does not work:
<!--#include file="../../includes/mo_security.asp" -->
So basically my site files are limited to one folder deep.
Ex: ROOT/parentFolder/files.htm
One I move another level down the includes do not work anymore:
Ex: ROOT/parentFolder/childFolder/files.htm
I am on a Windows IIS server. Is there any solution to this or is it just a limitation of the include statement?
I am using the ASP include statements for some HTML code, and I have the <body></body> tags included in an outside <!--#include--> file. Is this OK? Or could it mess something up not having the <body></body> tags in the actual page HTML?
I am still writting VBScript code and .asp pages for our Intranet. Recently I learned how to use include files from this site.
I was very successful using include statements as long as I put the include statement inside the subdirectory that contained the asp files I was using.
I would like to put the include files in the root or a seperate directory and be able to call them from a page tghat is in a different directory?
For some reason, I am having trouble with this. I want to have a select statement, such as -
<% Select Case Request("service") Case "s" <!-- #include file="includes/bottom_nav.inc" --> Case "p" <!-- #include file="includes/bottom_nav.inc" --> Case "a" <!-- #include file="includes/bottom_nav.inc" --> End Select %>
I know that is not the correct syntax for the include files.
I need some help with some if statements in an asp page I got. My sql statement is:
sql = "select * from courseDesc"
I want to logically diplay all the information on the page. So I inserted this if statement to choose the information I want to dispaly:
<% if rs("courseName") = "whatIsCist" then response.write(rs("description")) end if %>
Other courseName titles I need to display the information for further down the page, include: wdt, lan, wan, programming, admissionReq1,2,&3. Does anyone see where my problem is?
I'm having problems getting some ASP code to work with a form I'm using. I'm using the script with a multiple page form and want to print a javascript onsubmit value for just one of the forms. I'm getting errors because of the multiple IF statements and I'm not sure how to do this and have the "s show up properly in the output. Can someone tell me how to do this properly?
Code: <% If step < 5 Then Response.Write " <form action="/script.asp" method="post" name="theForm" id="theForm" & If step < 1 Then Response.Write " onsubmit=""" & "return checkForm(this);" & End If %> & ">" & End If %> Here is how I want it to output:
is there a way to use "or, and" statements in asp, what i want to do it do 2 seperate checks on the database and if one is true or the other one is true then display some text is this possible and also the same check again on the database but the first statement and the second statement has to be true then display some text is this possible, if yes how would i do it?
I didn't really get a direct answer in the .net forum so I guess I'll just post it here where it should be anyway. Instead of .net I'm just going to probaly stick with 3.0. I want to have several different templates for users to browse a site in.
Since I can't use include files in ASP is there a way I can ONLY load coding in an if statement as it applys to that certain user? I want to enclose multiple images and coding into one file but only load the ONE image/code that pertains to the user. Is this possible using if statements?
i am trying to find out if three feilds in a record match, if so send it to another page. basically see code.
Quote: rs.Open "Rental", cs, adOpenDynamic Do Until rs.EOF If rs.Fields("MemberID").Value=person And rs.Fields("DVDID").Value=dvd And rs.Fields("Current").Value=true then Response.redirect "copy.asp?memberid=" & person End If rs.MoveNext Loop
this does not bring up a problem just does not do it any ideas on if staemenst etc in asp thingy.
I have a (hopefully) simple question that has been giving me some problems. I'm trying to use a simple Select statement to access some data in an access database. In access, the sql statement is as follows:
SELECT TPL_Checklist_Master.[1] From TPL_Checklist_Master
However, when I try to do this on an ASP Page, it always causes an error. I'm assuming this is because of the [] around the field name 1. (I would change the field names, but I don't have control over that).
I know when trying to use a * in the statement Where field LIKE 'A*' I needed to replace the * with a %. I was wondering if something similar had to be done in this case. I hope my description is clear enought to follow.
We have currently launched a website in ASP and now want to add some tracking functions. We have banner ads and emails that we are launching.I would like to create code that will allow me to change the an image and a text link based on where the user is linking in from.
I.e If they clicked on banner xy - then the index page the images would be xy and the text box in another page would be xy. if they clicked on banner zz - then the index page the images would be zz and the text box in another page would be zz.
I have a project to do that requires that I use mysql as the database. I have only used MS Access. The sql will be simple searches. Is there a drastic difference, or just different punctuation? Can I find a copy of mysql on the web? If so, is there any advice on installing?
Is it possible to wirte a VBScript If statment that outputs different HTML? IE: If **** = True then do this HTML else do this HTML? How do you do something like that?
Basicly I pull the whole column contents and what to test to see if the username is that list. How can I do this in an if statement. I know how to do this kind of thing in SQL (LIKE operator) but I need to test agains two recordsets. Code:
Question 1: How can have th asp script automatically convert the date generated by the system to a format which is acceptable by Sybase SQL (yyyymmdd)
Question 2: If the user were to insert a a string containing " ' ", how can I convert it into a special character so that it won't be treated by Sybase SQL as the start/end of a variable?
I am getting an error on my sql update statement and I can't find where it is. I am getting the message, "syntax error in update statement". when I do a response.write on my sql statement this is what I get back
update tblUser set lastname='Ray', firstname='David', address='petal ms', email='david@ray.com', pass='dray', where username='dray'
Is it possible to use If Then statements in an a href tag? What I am trying to do is I am using a server side include page of navigation inside of a content management system. I have limitations on what I can manipulate and change. So just using style sheets won't do me the trick. I want to have a navigation link change a different color when you are on that section. I have the menu expanding also using if then statements. When a variable is passed somewhere else on the page as true, the menu expands. I figured I could use this in the same way to make the link change colors. I want to do something like:
<A href="#" <% If Variable_name then%> id="link <% end if %>>Link Here </a>
Is that possible? I know that i can do an If then statement and have 2 different links, one with the id and one without, but I wanted to see if I could simplify it at all. I'm not the best with ASP so there might even be better ways then that...I was just using from the little that I knew.
I'd like to combine if possible these two statements drawing from a total of 3 tables.
sql = "SELECT p.Sub_ID, p.Cat_ID, p.Sub_Name, COUNT(c.Sub_ID) as ct FROM Subs p LEFT JOIN Links c ON p.Sub_Id = c.Sub_Id GROUP BY p.Sub_ID, p.Cat_ID, p.Sub_Name ORDER BY p.Sub_Name"
sql = "select * from Subs inner join Cats on Cats.Cat_ID=Subs.Cat_ID ORDER BY Sub_Name"
Is it possible? Am I totaly screwed up for even trying? The goal is to count the relations ships in the Subs and Links table based on Sub_ID, to display needed data from the Subs table, and to display the Cat_name table from the Cats table in relationship to the Cat_ID in both the Cats and Subs Table.
I am trying to create a prepared statement in ASP, but am having problems with creating the parameter object. I do the following
Set fnParam = peopleUpdate.CreateParameter("@firstname", adVarChar, adParamInput, 50, peopleSourceRS("firstname"))
But this gives the following error on the browser:
Error Type: ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. The server doesn't seem to like adVarChar and adParamInput. I did try to create the parameter without arguments and then assign the properties, but it gives the same error for .Type and .Direction. What am I doing incorrectly here?
I have these two statements and I want to join them to make one query, i don't know how to do it since there are two querystrings that are selecting my data for me.
sSQL = "SELECT * FROM AssemblyName Where AssemblyName = '" & Request.QueryString("assembly") & "'" Set oRS = oConn.Execute(sSQL)
sSQL = "SELECT * FROM PartsList Where ID = '" & Request.QueryString("one") & "'" Set oRS2 = oConn.Execute(sSQL)
if not request("email") like "%@%" or not request("email2") like "%@%" then response.write "<span class=""whitebox500""><br>THIS DOES NOT APPEAR TO BE A PROPER EMAIL ADDRESS."
response.write "<br><br><Br><input type=button onClick=""javascript:history.back(-1);"" value=""Back to Signup <<""><br><br>" response.end end if
and want to wildcard test the request to see if it is properly formatted email with an @ and a dot.
Can i have 2 insert statements in my code inserting data in different tables.
So after i hit submit,the date should go and reside in particular tables.is it possilble?>and if yes..how do i do..any examples /links you can pass me?
I have a shopping cart that I want to load items in that come from a huge scrolling form. In other words, when someone clicks on a category in our site, it scrolls out all the items in that category, maybe 30 or more. I have text boxes next to each item so somone can enter a number, then press submit form button at the bottom of the form, and send those slections to the shopping cart.
The problem is, many of the text boxes are empty, yet they are still being sent to the shopping cart as a quatity of 0. Is there a way for sql to ignore a value if the variable is zero, or only get the sql statement to run if a variable is > 0?
I have two ASP statements (<% , %>) that I would like to insert into one ASP file. One of the statements is already inserted in the file and works successfully. However, when I insert the second ASP statement, the page comes up with an error;-
"Microsoft VBScript compilation error '800a0411'
Name redefined "
I am pretty sure I get this error because both statements are conflicting with one another. I also can't combine the two statements as I use a DSN connection for one, and a DSN-less connection for another and I connect to 2 different databases.
How might I be able to include both ASP statements within the single ASP file?
A user on another Forum said " there is a variable DIMmed twice.
easiest way is a third include with the variable names in. That way it can be used with any combination of the includes."
I need help with fixing my code below. It doesn;t work correctly. It works fine when there are 4 featured records. But I want to be able to change one to not be featured (equal to 0). This is not possible with my current code. It shows the same message about me not being able to have more than 4 featured records. Can someone please help me with this?
I'm working on a Calendar for my FrontPage web. I've been struggling interminably to write an SQL statement that only calls records based on a variable (today's date, in YYYYMMDD format).
Here's how I've declared the variable:
var mytext = (document.clock.thedate.value)
So now I write my SQL statement:
"SELECT * FROM cal_db WHERE Num_date = '" & Request.QueryString("mytext") & "'"
I know the query string is valid, since I can successfully execute a document.write command that correctly writes the string to my web page. But when I run the SQL, no results are returned.
I want to select a bunch of records where a certain field is equal to the following. Code:
if game <> "" thensql = "SELECT DISTINCT game, system FROM wallpaper WHERE system = 'ps2' AND system = 'gba' AND system = 'gf' AND system = 'xbox' AND system = 'xbox360' AND system = 'gba' AND system = 'ds' AND system = 'pc' AND system = 'psp' AND system = 'ps3' ORDER by ID DESC LIMIT 0, 10" Set rschanmedia = Server.CreateObject("ADODB.Recordset") rschanmedia.Open sql, conn, 3, 3
The script works fine but when I run it it doesn't display any records at all! Yet when I run a script where system is <> to something it works fine! What's wrong?
I use one of the first two if statements by themselves, and comment everything else out, the code works. But when I use more than one of these, i get a "page cannot be displayed" message.
I've also tried condensing if statements into ifelses. Same results. Anyone know why this would be happening? Code: