Variable Wildcard
Not sure if this is possible but, is there any way to search a variable like,
var = "I like to play jazz"
If "jazz" * = var then ( If the word jazz is included in the variable then)
response.write "Found Match"
end if
View Replies
ADVERTISEMENT
I'm trying to pass the wildcard variable % to another page via
request.querystring.
When I go to pick up the variable through request.querystring, it will
never diplay the "%" if one is included. It will diplay any other
characters included in the variable though.
Code from page 1:
<%response.write "<a href='Page_2.asp?Severity=" & varCombo_Severity &
"&Owner=" & varCombo_Owner & "'>" & "<i> Go to Page 2 </i>" & "</a>"
%>
Code from page 2:
<%varCombo_Severity = Request.Querystring ("Severity")%>
<%varCombo_Owner = Request.Querystring ("Owner")%>
Result: No % wildcards are passed though to page 2
Any ideas?
View Replies
View Related
I have a script which checks the current page name and write out a certain class if it's true to achieve an active menu item effect.
I want to expand upon it a little and have it check for any pages beginning with business rather than list business_dir_info.asp?id=2517 where there are loads of ids. At the moment it's just set to check for business.asp which is the top level page, is there any sort of wildcard character I can use?
View Replies
View Related
Var1 's content can be "errorone" o "errortwo" or "good". I need to detect if there is "errorone" or "errortwo" with the If clause. How can I do that using the wildcard?
Example that doesnt work: if var1 = *"error"* then
View Replies
View Related
Dear all, if in asp. i wanna to use the command request.querystring to check the URl. For example, my item when passing to next form will be either 4 or 6 character. How do i tell asp what to do if the string pass 4 character and if it pass 6 character.
My code example for 4 character is A100, 6 character is A10001. different number of character will have to perform different task for me.
I try to use "?" as wildcard but it fail Btw if i had stored chiense character in ACCESS, but when it go thru asp n display on IE, it show "???" instead of the chinese character.
View Replies
View Related
I am trying to show a series of movies on a web page. All of the movies are the same width, but have different heights. When I take out the width and height parameters, the pictures display fine, but the movies get the bottom cut off. When I put the parameters back, it stretches out the images to fit the entire box. Any way to make the height parameter a wildcard?
<<%=whattouse%> src="Upload/<%=(RS1.Fields.Item("xmedia_asset").Value)%>"
width="320" height="300" align="left" loop="false" controller="true"
autoplay="false"></<%=whattouse%>>
View Replies
View Related
I have the following SQL statement that returns a result set based on the exact input stored in a session variable
If reqname <> "" Then
strSQL = strSQL & "AND(ABR_REQUESTOR='" & reqname & "')"
The variable “reqname” is set to a session variable.
I amended the SQL to do a wildcard search instead of searching for the exact string stored in the Session variable:
I altered the SQL as follows:
strSQL = strSQL & "AND(ABR_REQUESTOR LIKE '" & reqname & "%')"
The problem is the field ABR_REQUESTOR stores the first and last name separated by a space...i.e. John Smith
Using the above SQL will return John Smith if I use J, Jo, Joh.
But, if I want to search for Smith by using S, or Sm, etc. it won't work.
I need to alter the statement to look for anything after a space?
View Replies
View Related
I have an Access database. I am using a dropdown search box. One of the options is "Search All States" and I set the value to %. In the recordset on the results page, I have the default set to %. Here is the SQL statement:
SELECT *
FROM ClientInfo
WHERE State = 'varState'
and varState = Request.Form("State")
However, I get no results when choosing this option in the dropdown Code:.
View Replies
View Related
In an ecommerce situation, when a category link is clicked, my results page shows the category name at the top of the page
This is working great apart from when a search is done without specifying category eg from the search page
So for example Results.asp?Category=%25&Keyword=&Submit=Search
This gives all products in the results page but just gives the last category name in the table as the heading
I would like to write a condition that just presents a static message eg �Results� when the search wildcard % is passed Code:
View Replies
View Related
I want to post a wildcard IP in a varchar field in my mysql table so when I call it in the script it shows up giving that entire range of IP's. I've tried doing it like.
24.129.184.* but it doesn't seem to work.
View Replies
View Related
what I want to do is get read a database entry and if it doesn't start with http:// then I want to include it.
I can't figure out what to use as a wildcard in the first line though
IF rsGuestbook("VisitorHome") = "http://" THEN
%>
<a href="<%=rsGuestbook("VisitorHome")%>" target="_blank">Name:
<%
ELSE
%>
<a href="http://<%=rsGuestbook("VisitorHome")%>" target="_blank">Name:
<%
END IF
View Replies
View Related
I'm trying to compare a form field from the previous page & write a response in the html on the current page. e.g
if (form field value) is like "Custom" then write Correct or else write Incorrect. Here's the code I have curently Code:
<%If (Request("RangeColour")) = ("Custom*") Then Response.Write("Correct") : Response.Write("")else Response.Write("Incorrect")%>
I've tried *, &, ? but they don't appear to work. I've also tried like "Custom*" but I receive an error about a sub or function not being declared.
View Replies
View Related
I have a little script that is supposed to check for a certain value in a db column, and then do something if that particular calue is present:Code:
...<%ElseIf rsIDK.Fields.Item("my_column").Value = "/default.asp" then ...
The problem is that my_column can contain up to 300 characters, so the code above doesn't work. What I really need is a wildcard at the end of "/default.asp" but I don't really know the correct way of doing this.
View Replies
View Related
I have a form where a user can choose one or more options from drop-down menus to search the db :
service
town
county
The id's are all numbers in a MySql database. I have put the default param for each search as % and this only changes if the relevant search option is chosen: Code:
View Replies
View Related
I created an ISAPI dll application to prevent SQL Injection attempts by
intercepting the HTTP requests and sanitizing both GET and POST variables (or
any combination of both) before the request reaches the intended code. This
is especially useful for legacy applications not designed to deal with MS SQL
Server Injection attempts. Though this application was designed with MS SQL
Server in mind, it can be used with no or minimal changes with other database
engines.
This ISAPI is only compatible with Internet Information Server (IIS) 6.0
which comes with Windows 2003. Windows XP uses IIS 5 engine which DOES NOT
support ISAPI Wildcard.
View Replies
View Related
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.....
View Replies
View Related
is there any way of passing a javascript variable over to a asp variable so
i can write it to my database.
View Replies
View Related
How do I convert an ASP variable to a Javascript variable?
View Replies
View Related
sql = "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?
View Replies
View Related
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
View Replies
View Related
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 Related
I have many buttons that mapping many textbox, when I click button, I
want to show a string that contains button number( and the mapping
string ), but it failed.
Here is the code:
/////////////////////////////////////////////////////////////////////
<%response.write"<input type='button' name="'btUS95resone"&" a &"'
value='Save' onclick='resone("&a&")'>"%>
function resone(cnt)
{
alert("document.all.txt_note"+cnt)
}
////////////////////////////////////////////////
It seems that the component I called is not there...
View Replies
View Related
Can anybody tell me what is the asp equivalent of the php-phrase:
if (!$Variable) {}
?
Another question: is there a special syntaxis for asp conditions in condition?
I tried this code it doesn t work:
If Condition Then
If 2nd condition Then
ElseIf Then
End If
End If
And it works only when I remove the 2nd condition's End If and the ElseIf. Seems strange, no?
View Replies
View Related
I have a text file that looks like this:
Artist Name: Kiss
Song Title: Rock and Roll All Night
Running Time: 04:38
And I need to be able to get the artist name and song title in asp and display it on a website. The thing is, the text file changes with the song being played on the radio. How can I do this?
View Replies
View Related
I've been given an ASP app written with server side javascript. This app needs to get the username of the person currently logged in to windows (Request.ServerVariables("AUTH_USER") in vbscript). I found a way to get this variable in javascript, but then it wouldn't let me split it (server kept saying method not supported). So I've gave up on getting the username with javascript, and have set variables in VBscript at the top of my page. How do I access those variables within the javascript portion?
View Replies
View Related
i have a textbix name "building" inside my system where the user might input one or several building name in it seperated by a comma. How can i extract each of the value in it? For example, "PG2, PG7, PG6", i want to extract each of them.
View Replies
View Related
I have this url that loads, but in the url is the date, so I need a variable i can use so as the date changes the url is automatically updated,
View Replies
View Related
using access db and asp
i have a variable from a form
sRound = request.form("round") and for now let us say this value is 3
now i want to include that 3 in sql, but it is part of a field name which
is round3_report
cm.CommandText ="UPDATE rounds SET round" & sRound & "_report = '" & var5 &
"' WHERE Name ='" & sName & "' AND meeting = " & var4 & ""
cm.execute
this isn't working. i keep getting parameter error. i know there is a way to
join a word with a variable in order to make a field name in asp/sql
View Replies
View Related
I am having difficulty in displaying Response.Write rsVacancies("Title") variable more than once. If I remove it from the page title it displays within the description tag but does not display in both. Code:
View Replies
View Related
I am tring to search a database with an SQL statement via a web page. I am using Dreamweaver to build my page. The search works great when I hard code the table field into the Recordset. However, I would like to implement a variable on the field in the table to do the search on.
For Instance, a user can make a selection in a drop down box and then enter the text in a text field. I am having trouble implementing the drop down box variable into the code. I suspect I need the WHERE to be a variable just as the LIKE parameter but I keep getting errors. Code:
View Replies
View Related
I have one condition for getting the image in an included file. If the file which is including the included file is from parent folder if should pull the image directly from Image folder, otherwise it should change the path like Code:
View Replies
View Related
I have created the pages for a website in HTML. I need a script in ASP that displayes the HTML pages when requested (EG: script.asp?page=HTMLpage1).
<html>
<head>
<title>Test site 1</title>
</head>
<body>
<% page = request("page")
select case page
case main: <!--#include file = "index.html"-->
case "services": <!--#include file = "services.html"-->
case "case_studies": <!--#include file = "case_studies.html"-->
end select
%>
</body>
</html>
Any ideas on how to make this work?
View Replies
View Related
for example, if i have Code:
do while not c.eof
if c.fields("id")=request.cookies("id") then
response.write "This is you"
else
response.write "This is " & c.fields("name")
end if
c.movenext
loop
the request.cookies("id") does not work! no variable will work in its position, either. the 'if...then' statement above will only work with c.fields("id")="something", not a variable, like i want. how can i get around this?
View Replies
View Related