Jump to content

beccatigger

Member
  • Posts

    327
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Posts 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

  6. Hi, another problem with my Charon cart

    I've got to the checkout and I can add my order details (OrderID etc etc)

    My tables in ms access are the following:

    Orders table:

    OrderID(primary key created during asp coding)

    OrderDetails table:

    OrderDetailsID (autonumber, primary key)

    OrderID (text, linked one to many with Orders.OrderID)

    etc etc

    When I try to do the function on the page, it will only add the OrderID to the OrderDetails table if it's the OrderDetails field is set to text and it's the primary key! (Thus removing the relationship between the two tables)

    Have also allowed session variables in my browser

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

    <!--#include file="inc_CharonCart.asp" -->

    <script language="javascript" runat="server">

    function GetTimeInMillisec()

    {

        var Now = new Date()

        var TimeStamp = Now.getTime()

        return TimeStamp

    }

    </script>

    <!--#include file="Connections/searching.asp" -->

    <%

    Dim Recordset1__var

    Recordset1__var = "1"

    If (CCcart_Subtotal <> "") Then

      Recordset1__var = CCcart_Subtotal

    End If

    %>

    <%

    Dim Recordset1

    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")

    Recordset1.ActiveConnection = MM_searching_STRING

    Recordset1.Source = "SELECT *  FROM postage  WHERE MinCost <= " + Replace(Recordset1__var, "'", "''") + " AND MaxCost > " + Replace(Recordset1__var, "'", "''") + ""

    Recordset1.CursorType = 0

    Recordset1.CursorLocation = 2

    Recordset1.LockType = 1

    Recordset1.Open()

    Recordset1_numRows = 0

    %>

    <%

    Dim rsOrders

    Dim rsOrders_numRows

    Set rsOrders = Server.CreateObject("ADODB.Recordset")

    rsOrders.ActiveConnection = MM_searching_STRING

    rsOrders.Source = "SELECT top 1 OrderID, SubTotal, PP, GrandTotal  FROM Orders"

    rsOrders.CursorType = 0

    rsOrders.CursorLocation = 2

    rsOrders.LockType = 3

    rsOrders.Open()

    rsOrders_numRows = 0

    %>

    <%

    Dim rsOrderDetails

    Dim rsOrderDetails_numRows

    Set rsOrderDetails = Server.CreateObject("ADODB.Recordset")

    rsOrderDetails.ActiveConnection = MM_searching_STRING

    rsOrderDetails.Source = "SELECT top 1 OrderID, ProductID, ProductName, UnitPrice, Quantity  FROM OrderDetails"

    rsOrderDetails.CursorType = 0

    rsOrderDetails.CursorLocation = 2

    rsOrderDetails.LockType = 3

    rsOrderDetails.Open()

    rsOrderDetails_numRows = 0

    %>

    <%

    '

    'Add shipping from a value in a recordset

    'The recordset may be pre-filtered based on the CCcart_SubTotal value

    '

    if not Recordset1.eof then

    CCcart_Shipping=Recordset1("PostCost")

    end if

    %>

    <%

    '

    'Insert record into Orders recordset when form is submitted

    'and store the unique OrderID

    '

    CC_OrderAction=Request.ServerVariables("SCRIPT_NAME")

    if Request("CC_OrderInsert") <> "" then

    TimeKey=GetTimeInMillisec()

    rsOrders.AddNew

    rsOrders("OrderID")=TimeKey

    For Each fld in rsOrders.Fields

    if Len(Request(fld.Name)) > 0 then

    fld.Value = Request(fld.Name)

    end if

    Next

    rsOrders.Update

    rsOrders.Requery

    rsOrders.Filter= "OrderID='" & TimeKey & "'"

    if rsOrders.eof = false then Session("OrderID")

    end if

    %>

    <%

    '

    '**Save cart to OrderDetails table in Database**

    '

    if Request("CC_OrderInsert") <> "" then

    'Bindingvalues=("ProductID,Quantity,ProductName,UnitPrice,")

    UniqueIdValue=Session("OrderID")

    UniqueIdColumn="OrderID"

    CC_RedirectURL="checkout2.asp"

    sub SaveToDatabase(ODRecordset)

    ODRecordset.AddNew

    ODRecordset.Fields(UniqueIdColumn)=UniqueIdValue

    ODRecordset.Fields("ProductID")=CCcart(CC_ProductID,i)

    ODRecordset.Fields("Quantity")=CCcart(CC_Quantity,i)

    ODRecordset.Fields("ProductName")=CCcart(CC_Name,i)

    ODRecordset.Fields("UnitPrice")=CCcart(CC_Price,i)

    rsOrderDetails.Update

    end sub

    for i=0 to ubound(CCcart,2)

    if CCcart(CC_ProductID,i) <> "" then

    Call SaveToDatabase(rsOrderDetails)

    end if

    next

    Response.Redirect "search2.asp"

    end if

    %>

    rsOrders gets the OrderID from Orders

    rsOrderDetails gets all the fields from OrderDetails (except for OrderDetailID as it's an autonumber)

    If anyone could help me out as to why it will only allow it when it's in the OrderDetailsID field that would be great.

  7. OK, It took me a day, but I figured it out

    You have to make a form, but it doesnt need a recordset as I suspected)

    However, the results page needs to link from that pull down menu. So u name the <select> tag so I named it category. Then when I made the recordset for the second page, you then filter the subject_area from books table with the url category, so when it flips onto the results page,then url would be, e.g.:

    search.asp?category=IT

    Here's the code examples, in case anybody ever has to go through the hell of making one of these babys:

    <%@LANGUAGE="VBSCRIPT"%>

    <!--#include file="Connections/query.asp" -->

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>

    <head>

    <title>Untitled Document</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <link href="styling.css" rel="stylesheet" type="text/css">

    </head>

    <body>

    <form action="search.asp" method="get" name="category">

      <select name="category" size="1" style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" >

     

    <option value="MS Office"><font class="pulldown">MS Office</font></option>

        <option value="ICT">ICT</option>

    <option value="Programming">Programming</option>

    <option value="Networking">Networking</option>

    <option value="Internet">Internet</option>

    <option value="Games">Games</option>

    <option value="DVDs">DVDs</option>

    <option value="Videos">Videos</option>

    <option value="Other">Other</option>

      </select>

      <input type=submit value="Submit!">

    </form>

    </body>

    </html>

    and the results page looks like this:
    <%@LANGUAGE="VBSCRIPT"%>

    <!--#include file="Connections/searching.asp" -->

    <%

    Dim Recordset1__MMColParam

    Recordset1__MMColParam = "1"

    If (Request.QueryString("category") <> "") Then

      Recordset1__MMColParam = Request.QueryString("category")

    End If

    %>

    <%

    Dim Recordset1

    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")

    Recordset1.ActiveConnection = MM_searching_STRING

    Recordset1.Source = "SELECT * FROM Books WHERE Subject_area = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"

    Recordset1.CursorType = 0

    Recordset1.CursorLocation = 2

    Recordset1.LockType = 1

    Recordset1.Open()

    Recordset1_numRows = 0

    %>

    <%

    Dim Repeat1__numRows

    Dim Repeat1__index

    Repeat1__numRows = -1

    Repeat1__index = 0

    Recordset1_numRows = Recordset1_numRows + Repeat1__numRows

    %>

    <%

    While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))

    %>

    <table border=2>

      <tr>

        <td><a href="details.asp?ID=<%=(Recordset1.Fields.Item("ID").Value)%>"><%=(Recordset1.Fields.Item("ID").Value)%></a></td>

      </tr>

      <tr>

        <td><%=(Recordset1.Fields.Item("Book_Name").Value)%><br></td>

      </tr>

      <tr>

        <td><%=(Recordset1.Fields.Item("Edition_number").Value)%></td>

      </tr>

    </table>

    <%

      Repeat1__index=Repeat1__index+1

      Repeat1__numRows=Repeat1__numRows-1

      Recordset1.MoveNext()

    Wend

    %>

    <%

    Recordset1.Close()

    Set Recordset1 = Nothing

    %>

  8. Hi, Long time no see!

    I've got a major problem that's annoying me loads!

    I've got this big project website that I've got to create using ASP and running a MS access db behind. It's a book database with a book table with book name, book ID, subject_area, etc.etc.

    I want to make a pull down menu with the subject areas in so you can display the results from a chosen category.

    So far, for the form, I've got this:

    this is the search page search.asp

    <html>

    <head>

    <title>List Box Titles</title>

    <head>

    <body>

    <h2>Search by subject category</h2>

    <p><br>

    <form method="get" action="results.asp">

      <select name="subject" size="1">

    <option value=accountancy>Accountancy</option>

    <option value=computing>Computing</option>

    <option value=dvds>DVDs</option>

    </select>

    <input type="submit">

    </form>

    </body>

    </html>

    then the results.asp is this:
    <html>

    <head>

    <title>Title Response</title>

    <head>

    <body>

    <h1>Bibliographic Data</h1>

    <%

    varTitle= request.querystring("subject")

    Set oRp=server.createobject("ADODB.recordset")

    sqltext="Select * from books WHERE subject_area = "';response.write "<p> Title Searched: <b>" & subject_area &"</b>"

    orp.open sqltext, "driver={microsoft access driver (*.mdb)};dbq=" & server.mappath("shop.mdb")

    if orp.eof then

    response.write varTitle & " Not Found"

    else

    response.write "<p>The Bibliographic Data is as follows:<br>"

    response.write "<p>Book: <b>" & orp("Book_Name") & "</b><br>"

    end if

    response.write "<p> <a href='search.asp'>Another search</a>"

    %>

    </body>

    </html>

    The bit hightlighted in red is wrong but i don't know how to reference it (maybe to the query string but I don't know how to?!)

    I'd be grateful for any help!

  9. I think it's only when u get successful invites that u get a lot more. As for new people, I don't know, theys a bit random as to when they hand em out. But if anyone wants Gmail, I'm gonna say PM me. Is tht pokies with everyone.

    Doggie I bet they are high quality steak knives....

  10. Has anybody else watched Space Ghost, it's so incredibly clever. It used to a cartoon but got cancelled in 1968 cos it was rubbish. Then, this guy took the characters and made it into a chat show. The chat show is set after a space war and he has "prisoners " The prisoners people he interviews are real people, e.g. Bjork and they do these interviews but they do online and offline editing so they can make people look really stupid, and make it funnier etc.

    Please someone tell me you've seen it!

  11. Lets face it, Yahoo don't wanna lose their customers to GMail. But gmails' gonna be so much better because you can actually search thru ya mail and stuff instead of going daaan the list. Plus we all love google so show them some respect by having their email addy too. Also, I'd just like to add, that Hotmail have gotta be worse in the way of spam, not a day goes by without me being asked if I'd like some viagra or a penis enlargement. Funny that, cos last time I looked, I was a girl.........

  12. Leeta, PM me ur address, I have some invites but in future, I don't wanna hear anyone moaning, it's only a flippin email account. It's like flies around a fresh pile of poo.

    Now, I have 2 left, does anyone else want one for themselves, who doesn't already have one and not for their friends?

  13. Well if you read the beginning of this post leeta it said I had to start again. I didn't see the point in going through the thread. So go get ur strop off, I'm sure I will have some more very soon to give out, although you've bin pretty eggy so I might not bother.

  14. RIGHT, ANYONE THAT ALREADY HAS A GMAIL ACCOUNT, BUT IT TRYING TO SCAB ONE FOR THEIR FRIENDS CAN FORGET IT, COS IT'S NOT FAIR ON THE OTHERS WHO DON'T HAVE ONE. AND YES, I WILL FIND OUT IF YOU HAVE ONE ALREADY SO PLEASE BE CONSIDERATE AND LET SOMEONE ELSE HAVE YOUR INVITE...

    I will contact the first four people to want one for themselves by private message later

    Love becs

  15. KS3? ha ha ha ha piece of wee. I managed to avoid ever having to do any official exams before 16 because I was in a private school and it's only state ones that have to do it.

    Try doing a university degree, tho to be honest, A-levels were harder.

    PS, I did the duffy one for GSCE-jeezus, that was 3 years ago. I didn't like the depressing war ones.

    Just found out the result for my actionscript module today-71% woohoo! Rock on

×
×
  • Create New...