Jump to content

vinphetamin

Members
  • Posts

    32
  • Joined

  • Last visited

Everything posted by vinphetamin

  1. if you are using vbscript from within an asp page it is very simple: <% nameGoesHere = request("nameGoesHere") response.write nameGoesHere &"<br />"%><form> <input type=text name="nameGoesHere"> <input type=submit value="Submit"></form> If you are going to stay in html things get a little trickier: <script language="vbscript"><!--document.write(location.search)--></script> The above example brings back the entire querystring. To find specific values of variables you would have to cut it up using functions like split,replace,mid etc.
  2. one more.. <script language="vbscript"><!--Dim dateArray(12) dateArray(1)="http://www.google.no" dateArray(2)="http://www.google.co.uk" dateArray(3)="http://www.google.com" dateArray(4)="http://www.droppingthebomb.com" dateArray(5)="http://www.google.no" dateArray(6)="http://www.google.co.uk" dateArray(7)="http://www.google.no" dateArray(8)="http://www.google.co.uk" dateArray(9)="http://www.google.com" dateArray(10)="http://www.droppingthebomb.com" dateArray(11)="http://www.google.no" dateArray(12)="http://www.google.co.uk"'document.write(dateArray(month(date)))location.href=dateArray(month(date))--></script>
  3. Another way is to use an array: <script language="vbscript"><!-- Dim url url=array("http://www.google.no","http://www.google.co.uk","http://www.google.com","http://www.droppingthebomb.com","http://www.google.no","http://www.google.co.uk","http://www.google.com","http://www.droppingthebomb.com","http://www.google.no","http://www.google.co.uk","http://www.google.com","http://www.droppingthebomb.com") location.href=url(month(now)-1) 'arrays begin at zero!--></script>
  4. Just change the urls for the following: <script language="vbscript"><!--select case(month(now)) case 1 url = "http://www.droppingthebomb.com" case 2 url = "http://www.google.no" case 3 url = "http://www.google.co.uk" case 4 url = "http://www.droppingthebomb.com" case 5 url = "http://www.google.se" case 6 url = "http://www.google.com" case 7 url = "http://www.google.com" case 8 url = "http://www.google.com" case 9 url = "http://www.google.com" case 10 url = "http://www.google.com" case 11 url = "http://www.google.com" case 12 url = "http://www.google.com" case else url = "http://www.yahoo.com"end select'document.write(url)location.href=url--></script>
  5. <a href="print.asp" target=_blank>test</a>print.asp:<body onload="print();window.close();" style="margin:0;"><p><iframe name="I1" src="http://www.yahoo.no" style="width:100%;height:100%" marginwidth="1" marginheight="1" scrolling="no" border="0" frameborder="0">Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></p></body>?
  6. or <script language="vbscript"><!--document.write("<a href="&chr(34)&"http://www.google.com"&chr(34)&">Google</a>")--></script><%=chr(34)%>
  7. Not sure I understood the question or if this is any help but it may get you started on the right track. After all, it's another hour until I usually wake up. Think you may be better off letting the database do all the work and try not to use the on error clause, (it will probably bring back undesired results if the script fails unless you set up some form of error control).Select the following and save it as an asp page:<%'--------------------------'Variables'-------------------------- thisDate = date() my_numbers = ",5,16,10,30,31,32" my_nos = my_numbers win_list = ",10,20,30,31,32,40," win_list = numeric2(win_list) 'This will strip out any data that isn't a number or comma match_count = 0 match_list = ""'--------------------------'Check Results'-------------------------- newSplit = split(my_numbers,",") For each my_numbers in newSplit check_number = numeric(my_numbers) if instr(win_list, ","&check_number&",")>0 then match_count = match_count + 1 match_list = match_list &","& check_number end if Next'--------------------------'Check Prizes'-------------------------- select case(match_count) case 3 prize = "balik taya" case 4 prize = "800" case 5 prize = "20000" case 6 prize = "Jackpot" case else prize = "talo" end select'--------------------------'Highlight Matches'-------------------------- if win_list<>"" then newSplit = split(match_list,",") For e = 1 to ubound(newSplit) win_list = replace(win_list,","&newSplit(e)&"," , ",<font color='#FF0000'><b>"&newSplit(e)&"</b></font>,") Next end if'--------------------------'Functions'-------------------------- function numeric(iStr) strValidChars = "0123456789" iWord = "" if iStr<>"" then For i=1 to len(iStr) iChar = mid(iStr,i,1) if instr(strValidChars,iChar)>0 then iWord = iWord & iChar Next end if numeric = iWord end function function numeric2(iStr) strValidChars = "0123456789," iWord = "" if iStr<>"" then For i=1 to len(iStr) iChar = mid(iStr,i,1) if instr(strValidChars,iChar)>0 then iWord = iWord & iChar Next end if numeric2 = iWord end function'--------------------------'Test'--------------------------' response.write prize &"<br />"' response.write win_list &"<br />"' response.write my_nos &"<br />"' response.write match_count &"<br />"' response.write match_list &"<br />"%><table border="1" width="100%"> <tr> <td>DATE</td> <td><%=thisDate%> </td> </tr> <tr> <td>RESULT</td> <td><%=win_list%> </td> </tr> <tr> <td>MATCHED NUMBERS</td> <td><%=match_list%> </td> </tr> <tr> <td>MATCHES</td> <td><%=match_count%> </td> </tr> <tr> <td>PRIZE</td> <td><%=prize%> </td> </tr></table>If that is along the right lines all you have to do is substitute the variables:my_numbers (with the numbers you are going to check)win_list (with the resultant numbers from the database query).Bear in mind that if you wanted to check on the press of a button using this method (asp) you would have to reload the page to make this code execute.Let me know how it goes.Cheers
×
×
  • Create New...