I Need A Quick Function Lesson...
if you have a function in an include file, and you copy that function and give it a different name.... and then you change the name in your call.. shouldn't it work just like the old function did?
View Repliesif you have a function in an include file, and you copy that function and give it a different name.... and then you change the name in your call.. shouldn't it work just like the old function did?
View Repliesim using cdosys to send an email from an asp page. is there a way i can insert the current page as the body of the email? i know i can send an HTMLBODY and specify a url.... but that wont work because the page is dynamically generated... so i need to be looking at a page, click a button and have the html of that page inserted as the body.
View Replies View Relatedi want to run some code is a certain condition is met and i can't figure this part out
i want if the button is pressed then will run my code else will run my other code
but how do i specify this button. if "button" is pressed?
how can I count specific charaters in a string?
like the amount of backslashes in-
"D:Inetpubsite hisstring"
How do I force the order of a SQL query?
My table has a field called ModelName which could contain 1 of 5 vehicle
models. I want to force the query to order these in a particular order (not
alphabetical, but an order that I have determined ('Range Rover',
'Discovery', Land Rover', 'Jeep', 'Others')
Let's say my current query is:
"SELECT DISTINCT ModelName FROM tblVehicles"
What do I need to tag on the end to order the result as stated?
1)How can i work out if a certain user is still online? All the pages the user will be able to view has a "check this password etc etc" so i could work it out that way, but would prefer to try and use sessions
2)Work out when a visitor last visited the site. I would like it so that this is only updated when the user LEAVE the site or CLOSES the browser - so it cant be updated on every page
3)Work out what users are on what pages. Again will probably mean sessions but how?!
4)Work out what pages (threads) the user has looked at. I know both vbulletin and snitz do something with the users last visit (question 2) and the last post...but how does it work
On the DATE function, if I want to delete everything that is more than 30 days old,
would I check for DATE-30?
I building a page showing the different times in different parts of the world but if the local time is 08:15:25 and I subtract 10 hours, it displays 0-2:15:25. How can I show it as 22:15:25.
View Replies View RelatedIm looking since the begining of the week about saving the enter(vbcrlf) from the html <textareato my MySql database, it save everything but it just loose everything when saving ot the database, do i need a special component to be able to save the enter and tabs etc. Im sure i was able to do it before and it was easy.
View Replies View RelatedI need a pattern to do this:
"?caid=[0-9]+&pgid=oRS("pgId")"
Where [0-9]+ means you need atleast 1 number there, the rest is just a string plus my recordset's variable. I know this syntax would work with the regex I learned at school but I'm not sure how to make it work in ASP.
Does anyone have a snippet to hand where i can create a dynamic dropdown for a credit card page, basically i need to dynamically create a drop-down populated with this year as 2006 and go back 4 years?
View Replies View RelatedI m using MSQL and I m trying to create table where the first column is autoincremented, this, however, generates a syntax error. I can t figure out the problem:
Create Table tblAuthor (ID int(11) auto_increment,AuthorName varchar(200), primary key(ID));
Error Message: Line 1: Incorrect syntax near 'auto_increment'.
can anyone tell me where i can get a good tutorial for a quick search.
View Replies View RelatedHow can I add a quick drop down menu to an asp page? I've tried to incorporate javascript and I can't seem to make it work. I want it to replace the current navigation on this page.
http://www.compsports.com/poll.asp?No=1
I want to add a "quick search" functionality in ASP or ASP.NET page. I heard
we can use Microsoft Indexing Service to accomplish the task, but not sure
how to do it. Is this the correct approach? Code:
i am using the following code to generate a xls file using the content type now when the user opnes the file at his pc it takes long time to open..if the no of records in file is large does the use of html tags has slow down the process of opening in excel. Code:
View Replies View RelatedWhat's the difference between private and public functions in ASP? When should I use either?
I am using a simple guestbook /portal and i want script to send mail to the thread owner when someone reply his message.
this is the send message code ....
Can I define a function inside a function. e.g;
function abc()
function xyz()
....some code.....
End Function
End Function
I googled this but can't find any related topic.
I want to use the instr function, but return results from it depending on surtain functions, I can't realy explain so I'll show my example:
I have a string in wich some word I want to find might be in diffrent Capital Letters order, I want the Instr function to return all the values of the place of that word (avcourse I'll run a for and increase the starting point of the Instr func until it returns 0). The instinct thought is to use the Lcase or the Ucase functions, but in this case I don't know how to use them. In the same Idea I wanted to use the Instr Func with the trim Func, But Its realy the same principle if I just understood how to do so.
I am trying to call a function in asp to check to see if a varibale has a value stored in it if there is nothing wite the value NA into it. My code is
<%
Function NullValues(userField)
if userField = "" then userField = "NA"
end function
AccountNo = ""
Name = "sam clowes"
email = ""
AccountNo = (NullValues(AccountNo))
Name = (NullValues(Name))
email = (NullValues(email))
response.Write AccountNo & "<br>"
response.Write Name & "<br>"
response.Write email & "<br>"
%>
When I run this code ALL the variables are blank and nothing is output
the function
<%
Dim objXML, objXSL
Function ShowXML(strXML,strStyleSheet)
Set objXML = CreateObject("MSXML.DOMDocument")
Set objXSL = CreateObject("MSXML.DOMDocument")
objXML.load(Server.MapPath(strXML))
objXSL.load(Server.MapPath(strStyleSheet))
Response.Write objXML.transformNode(objXSL)
Set objXML = Nothing
Set objXSL = Nothing
End Function
%>
calling the function in an asp file
<%Call ShowXML("http://msn.foxsports.com/feedout/syndicatedContent?categoryId=142","nhl/xsl/news/teamNews.xsl")%>
the errors
1. the http:// part
2. and the ? mark
the error message says that the path has been typed wrong.
the user can key in variable A and B
then C is auto generated by C = A / B
so how and where should i write the C function??
Possibly a very simple question but how do I get a value out of an XML document so I can play with it in ASP
E.G: <Name>Tom</Name
How do I pull the work tom into asp
I am using the now() function to be displayed on an email after a form submission has been sent. The problem is that the server is not in the same timezone as I am for the result. How do I adjust the hours on the now() to allow for this please ?
View Replies View RelatedI know the basic difference between a subroutine and a function is a
subroutine performs a task and a function performs a task and returns a
value. The Call keyword is required when using parens with subs with more
than 1 parameters. Parens around values passed are ByVal vs ByRef and is a
waste of processing if passed ByRef for no reason.
I am told there is no reason to ever use a subroutine as a function can be
used even if it doesn't return a value. While this appears to be true, is
there any reason why it's ever a bad idea to use a function, instead of a
subroutine, that doesn't return a value? Are there memory, performance,
etc. issues?
I am trying to locate information on how to call a sub within VBScript on an
ASP page but I can't locate generic information. What I want to do is
generate a page that will stay up but the information on it will change
based on a series of drop down boxes. I need the first drop down box to call
a second dropped down box based on the state that is chosen then city and so
on.
I have a column in the table which contains 2 full names seperated by "&" (e.g: Joe Smith & Jeff Scott) I want to display only the first names of the whole record in an asp page. Is there an asp function using which i can do this?
View Replies View Relatedim using the mod function to create a calendar for me, which everything works perfectly, all is totally well with that!
but...when i use the mod function it churns out this loooooooooong string which is the whole table...
if there is some way that i can insert hard breaks IN THE CODE ITSELF.
I used to be quite an experienced ASP programmer but I haven't used it for a while
I’m trying to do something that I remember as very simple I'm trying to check that the value of a form text box is numerical using the isNaN function. The code I am using is:
<%
quantity = Request.Form("number1")
if isNaN(quantity) = true then
Response.Write "Your input was not a number"
else
Response.Write "Your input was a number"
end if
%>
All I get is a NaN type mismatch error.
Is there a function to check to see if a string contains a space
Thanks
I was just wondering when using the mid function how does the assigment work when the length is longer then string itself? For example
test = mid(12345, 1, 10)
What would be the end result of test?Would it be 0000012345 or 1234500000 or 12345?
When I create a single character string
var str = "A"
'convert to ascii
num = asc(str)
Response.Write num ' 65 shows up
'when I have a whole string
str = "hello"
str = mid(str, 1, 1) ' return 'h'
num = asc(str)
'I get an error:
Invalid procedure call or argument:'asc'What can be done to fix this?