serving pages in ASP ala PHP

Discussion in 'ASP General' started by -[ CaMeL ]- a55m0nk, Oct 25, 2003.

  1. Hi there

    i am creating a clan website in ASP and am making a page serving
    script

    a link sends a query to the default page and then serves the page by
    grabbing the HTML from a database that refers to the pageID.

    this works like a peach whenever the page is just HTML
    e.g. http://www.deathworld.net/camel2.0/default.asp?id=2

    but when i try and add ASP code to it (for a news page etc), it just
    prints the ASP and does not execute it
    e.g. http://www.deathworld.net/camel2.0/default.asp?id=1

    Any ideas on how to do this would be much appreciated. is there a way
    of doing it this way? or is there a work-around without a huge
    default.asp file size?

    many thanks
    a55m0nk
    (jack bastow)
     
    -[ CaMeL ]- a55m0nk, Oct 25, 2003
    #1
    1. Advertising

  2. -[ CaMeL ]- a55m0nk

    Ray at Guest

    You can Server.Execute the pages.

    Ray at home

    "-[ CaMeL ]- a55m0nk" <> wrote in message
    news:...
    > Hi there
    >
    > i am creating a clan website in ASP and am making a page serving
    > script
    >
    > a link sends a query to the default page and then serves the page by
    > grabbing the HTML from a database that refers to the pageID.
    >
    > this works like a peach whenever the page is just HTML
    > e.g. http://www.deathworld.net/camel2.0/default.asp?id=2
    >
    > but when i try and add ASP code to it (for a news page etc), it just
    > prints the ASP and does not execute it
    > e.g. http://www.deathworld.net/camel2.0/default.asp?id=1
    >
    > Any ideas on how to do this would be much appreciated. is there a way
    > of doing it this way? or is there a work-around without a huge
    > default.asp file size?
    >
    > many thanks
    > a55m0nk
    > (jack bastow)
     
    Ray at, Oct 25, 2003
    #2
    1. Advertising

  3. "Ray at <%=sLocation%>" <myfirstname at lane 34 . komm> wrote in message news:<#>...
    > You can Server.Execute the pages.
    >
    > Ray at home
    >
    > "-[ CaMeL ]- a55m0nk" <> wrote in message
    > news:...
    > > Hi there
    > >
    > > i am creating a clan website in ASP and am making a page serving
    > > script
    > >
    > > a link sends a query to the default page and then serves the page by
    > > grabbing the HTML from a database that refers to the pageID.
    > >
    > > this works like a peach whenever the page is just HTML
    > > e.g. http://www.deathworld.net/camel2.0/default.asp?id=2
    > >
    > > but when i try and add ASP code to it (for a news page etc), it just
    > > prints the ASP and does not execute it
    > > e.g. http://www.deathworld.net/camel2.0/default.asp?id=1
    > >
    > > Any ideas on how to do this would be much appreciated. is there a way
    > > of doing it this way? or is there a work-around without a huge
    > > default.asp file size?
    > >
    > > many thanks
    > > a55m0nk
    > > (jack bastow)


    how would i go about doing that? here is my code:

    '----------Page Serving Code-----------'
    dim strPageSQL, strPageConn, strBody

    strPage = request.querystring("id")
    if strPage = "" then
    strPage = "1"
    end if

    strPageSQL = "SELECT pageBody FROM tblPage WHERE pageID = " & strPage
    & ""
    Set strPageConn = Server.CreateObject("ADODB.Recordset")
    strPageConn.Open strPageSQL, "CaMeL", 3, 3

    strBody = strPageConn("pageBody")

    strPageConn.close
    set strPageConn = nothing
    set strPageSQL = nothing
    '--------------------------------------

    then i do <%=strBody%> in the section it is required. How could i do a
    server.execute for this script?

    thanks
    a55m0nk
    (jack bastow)
     
    -[ CaMeL ]- a55m0nk, Oct 26, 2003
    #3
  4. -[ CaMeL ]- a55m0nk

    Ray at Guest

    Ah, so you're storing actual asp code in your database, eh? Nice. You
    could try playing around with the Eval function and/or the Execute
    statement.

    Ray at work


    "-[ CaMeL ]- a55m0nk" <> wrote in message
    news:...

    >
    > how would i go about doing that? here is my code:
    >
    > '----------Page Serving Code-----------'
    > dim strPageSQL, strPageConn, strBody
    >
    > strPage = request.querystring("id")
    > if strPage = "" then
    > strPage = "1"
    > end if
    >
    > strPageSQL = "SELECT pageBody FROM tblPage WHERE pageID = " & strPage
    > & ""
    > Set strPageConn = Server.CreateObject("ADODB.Recordset")
    > strPageConn.Open strPageSQL, "CaMeL", 3, 3
    >
    > strBody = strPageConn("pageBody")
    >
    > strPageConn.close
    > set strPageConn = nothing
    > set strPageSQL = nothing
    > '--------------------------------------
    >
    > then i do <%=strBody%> in the section it is required. How could i do a
    > server.execute for this script?
    >
    > thanks
    > a55m0nk
    > (jack bastow)
     
    Ray at, Oct 27, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pradeep Kumar

    Serving ASP .NET pages from a Linux Server

    Pradeep Kumar, Nov 10, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    549
    Thomas F.B.
    Nov 10, 2003
  2. Replies:
    31
    Views:
    1,103
    Geoff Berrow
    Jul 22, 2006
  3. Rajive Narain
    Replies:
    0
    Views:
    2,091
    Rajive Narain
    Sep 18, 2009
  4. Geoff Winsor

    IIS 6.0 bottleneck when serving ASP pages

    Geoff Winsor, Jun 18, 2004, in forum: ASP General
    Replies:
    1
    Views:
    155
    Jeff Cochran
    Jun 18, 2004
  5. Marc Heiler

    Webrick serving php pages?

    Marc Heiler, Jul 29, 2006, in forum: Ruby
    Replies:
    2
    Views:
    264
    Matt Todd
    Jul 29, 2006
Loading...

Share This Page