Results 1 to 2 of 2

Thread: Complete Novice, Please help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Somerset, UK
    Posts
    93

    Question Complete Novice, Please help

    Hi,

    I wonder if anybody can help. I'm writing an isapi filter to handle asp querystring. As a VB programmer all this c++ coding
    is getting me out of my depth. What I want it to do is take a URL in and split it into a querystring. Basic explaination is

    1) Check for .asp
    2) Check for szSep (e.g idx)
    3) Copy URL upto szSep
    4) Extract Middle bit (upto .asp)
    5) Concatenate StartBit & ".asp"
    6) Add on "?id=" & MiddleBit

    I've almost got it working (see below) but the rem'd out bits is where I'm stuck (it's part C++ and part VB) - but I'm worried about
    leakage if I don't do it properly

    Please Help......


    My code goes something like....

    char aa[1000];
    DWORD CURLRewriteFilterFilter::HttpFilterProc(PHTTP_FILTER_CONTEXT pFC, DWORD dwNotificationType, LPVOID pvNotification)
    {
    HTTP_FILTER_PREPROC_HEADERS *p=(HTTP_FILTER_PREPROC_HEADERS *)pvNotification;
    unsigned long d = sizeof(aa);;
    char *szSep = "idx";

    p->GetHeader(pFC, "url", aa, &d);
    char *FoundInst;
    FoundInst = strstr(strlwr(aa), ".asp");
    if (FoundInst!= 0)
    { FoundInst = strstr(strlwr(aa), strlwr(szSep));
    if (FoundInst!= 0)
    {
    //szNewURL = Left(szURL, iStartPos - 1)
    //iStartPos = iStartPos + 3
    //szID = Mid(szURL, iStartPos, Len(szURL) - (iStartPos + 3))
    //If Len(szID) > 0 Then szNewURL = szNewURL & ".asp?id=" & szID
    p->SetHeader(pFC,"url", szNewURL);
    }
    }
    return SF_STATUS_REQ_NEXT_NOTIFICATION;
    }

  2. #2
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    If you don't know a thing about C++, I suggest that you learn that before you launch a big project like that. And then set your aims a bit lower at the beginning....you will not be able to create a high tech c++ app right away....but you will if you learn
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width