Jump to content


  • Posts

  • Joined

  • Last visited

  • Donations

  • Country

    United States

Everything posted by beccatigger

  1. Hiya, I'm on a shared hosting plan and making a site (asp) with lots of pages which I don't want users to be able to access by simply typing the url into their browser. I've thought of a couple of ways to do it like seeing if the http_referrer was the page I posted from and perhaps moving the pages above wwwroot but just wondered if these are viable and if there are any other suggestions of ways to stop people accessing them? Also how do I stop people accessing the images folder? This is all bearing in mind I can't change the permissions on the folders.
  2. I'm having this annoying problem with msn messenger v. 8.0.0812.00. All my contacts online also show as offline as well, and any that are offline have another offline entry too. I don't know what an earth is going on. I uninstalled it and reinstalled it but to no avail. Any ideas how I can solve the problem? Oh and also my msn display name doesn't update from location to location.......
  3. I'm having trouble trying to insert checkbox values into an access database. Basically, I've got a form with checkboxes in and checkbox values. It takes the checked checkbox values, then split them into an array. Now I want to put the array values into a table (on seperate rows, so multiple inserts at once). The table structure is CustomerNumber & CustomerType which are both numbers. The customernumber is the same for each checkbox value inserted during the form submission. Currently I can get this code to work to write out each checkbox value like this: <% CT= Request.Form("ctcheckbox") myArray=Split(CT,",") For i=LBound(myArray) to UBound(myArray) Response.Write myArray(i) Next%> But I need to include it in this code to insert it into the database, but I don't know how to reference the array: <% if(Request.Form("Comnum") <> "") then Command1__CN = Request.Form("Comnum") %> <%set Command1 = Server.CreateObject("ADODB.Command") Command1.ActiveConnection = MM_conn2_STRING Command1.CommandText = "INSERT INTO CustomerTypes (CustomerNumber, CustomerType) VALUES (" + Replace(Command1__CN, "'", "''") + ",'myArray') " Command1.CommandType = 1 Command1.CommandTimeout = 0 Command1.Prepared = true Command1.Execute() %>
  4. Hiya, Having considerable trouble due to my inexperience with asp. I don't have time to learn php so that's out. Basically I've got a Company table and a customer type table, and a customer types table (link table) Where customer types has the primary keys from the other tables: company type and company I've made a customer details edit form where you can change all their details in one form so you can edit data from any tables. When you edit their customer types it'll show checked checkboxes where the customertype from customertypes and the customernumber matches the customer type in Customertype table So you got it a bit like this: [x] Type 1 Customer [ ] Type 2 Customer [x] Type 3 customer [x] type 4 customer OK so what I'm trying to do is compare the values of the checkboxes and if they've changed then delete or insert the values into customertypes as necessary. I tried to do it with the command function (cos you can't use their insert / delete record thing more than once) in DW but it won't pull the variables out for some reason. Also it doesn't seem to like me having more than one variable. Anyway here's the section of code (command deleted cos it just kept saying it was wrong): <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!--#include file="Connections/conn2.asp" --> <% Dim Recordset1__CN Recordset1__CN = "1" If (Request.Form("CompanyNumber") <> "") Then Recordset1__CN = Request.Form("CompanyNumber") End If %> <% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_conn2_STRING Recordset1.Source = "SELECT * FROM SelectCusType WHERE CompanyNumber=" + Replace(Recordset1__CN, "'", "''") + "" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() DO WHILE NOT Recordset1.EOF IF x <> total THEN CusType = CusType & Recordset1.Fields.Item("Number").Value & "," ELSE CusType = CusType & Recordset1.Fields.Item("Number").Value END IF x = x + 1 Recordset1.MoveNext LOOP Recordset1_numRows = 0 %> <% Dim Recordset2 Dim Recordset2_numRows Set Recordset2 = Server.CreateObject("ADODB.Recordset") Recordset2.ActiveConnection = MM_conn2_STRING Recordset2.Source = "SELECT * FROM Company" Recordset2.CursorType = 0 Recordset2.CursorLocation = 2 Recordset2.LockType = 1 Recordset2.Open() Recordset2_numRows = 0 %> <% Dim Recordset3 Dim Recordset3_numRows Set Recordset3 = Server.CreateObject("ADODB.Recordset") Recordset3.ActiveConnection = MM_conn2_STRING Recordset3.Source = "SELECT * FROM [Customer Type] ORDER BY Number" Recordset3.CursorType = 0 Recordset3.CursorLocation = 2 Recordset3.LockType = 1 Recordset3.Open() Recordset3_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 Recordset1_numRows = Recordset1_numRows + Repeat1__numRows %> <% Dim Repeat2__numRows Dim Repeat2__index Repeat2__numRows = -1 Repeat2__index = 0 Recordset3_numRows = Recordset3_numRows + Repeat2__numRows %> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="crap" > <input type="text" name="ComNum" value="<%=(Recordset2.Fields.Item("CompanyNumber").Value)%>"> <% While ((Repeat2__numRows <> 0) AND (NOT Recordset3.EOF)) %> <input type="checkbox" name="ctcheckbox" value="<%=(Recordset3.Fields.Item("Number").Value)%>" <% If instr(CusType,Recordset3.Fields.Item("Number").Value) > 0 Then Response.Write("Checked") %>> <%=(Recordset3.Fields.Item("Customer Type").Value)%> <br> <% Repeat2__index=Repeat2__index+1 Repeat2__numRows=Repeat2__numRows-1 Recordset3.MoveNext() Wend %> <input type="submit" value="go"> </form> </body> </html> <% Recordset1.Close() Set Recordset1 = Nothing %> <% Recordset2.Close() Set Recordset2 = Nothing %> <% Recordset3.Close() Set Recordset3 = Nothing %> Now I'm assuming I've got to do some comparison of the values in the table and then if they#'re different, insert or delete, is this correct? Any help would be muchly appreciated as I've wasted too many hours battling against DW and ASP!
  5. [sorry can you move my post to programming....apologies] Hi Guys, I'm working on a stupid uni project which I am totally stuck on and I've been going over and over and now I've got to the point where I've basically got to hand it in and I really need some help. Basically I've got to make a ball bounce around off some fixed walls and we HAVE to use collision trees. (I mean don't even get me started on how stupid that is) The ball has to move at a constant speed, bounce off the walls and then keep moving post-collision All I can do is get the ball to move.....thats it. I'd be really grateful for ANY help you can give me, can't find this ANYWHERE and you guys have always been so good helping me out in the past.......I just feel so dumb for not being able to do this Here's what I got so far: for(int i = 0; i <=3; i++) { if(ballx >= rootNode.child.xstart && bally >= rootNode.child.ystart && ballx <= rootNode.child.xend && bally <= rootNode.child.yend) { System.out.println("ball found in sector"+rootNode.child.name); } if (rootNode.child.name=="A") { for(int a = 0; a <=3; a++){ if (ballx >= rootNode.child[0].child[a].xstart && bally >= rootNode.child[0].child[a].ystart && ballx <= rootNode.child[0].child[a].xend && bally <= rootNode.child[0].child[a].yend) { System.out.println("ball found in sector"+rootNode.child[0].child[a].name); } } } else if(rootNode.child.name=="B") { for(int a = 0; a <=3; a++){ if (ballx >= rootNode.child[0].child[a].xstart && bally >= rootNode.child[0].child[a].ystart && ballx <= rootNode.child[0].child[a].xend && bally <= rootNode.child[0].child[a].yend) { System.out.println("ball found in sector"+rootNode.child[0].child[a].name); } } } } I urgently and eagerly await your help!!!!! Thanks Becs

  • Create New...