Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - mode or case or text
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

mode or case or text

 Post Reply Post Reply
Author
aero View Drop Down
Groupie
Groupie
Avatar

Joined: 21 May 2003
Location: Denmark
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote aero Quote  Post ReplyReply Direct Link To This Post Topic: mode or case or text
    Posted: 01 January 2004 at 8:23pm

Hi

I want 2 make a newsscript where the newsmaker.asp, newslist.asp, newsupdate.asp, newsdelete.asp is on one single site.

I dont know how i shut make it but knows that the links can be showet as this:

DOMANE/test.asp?mode=newsmaker
DOMANE/test.asp?mode=newslist 
and so on.

and If i just will see a single record then the link can look like this:

DOMANE/test.asp?mode=singlenews&UID=3

but how do I make the code !?? can it be make like this:

MY HTML,HEAD AND SOME BODY CODE......Then the TD where the things shut be showet.
<%
dim mode
mode = request.querystring("mode")
if len(mode)=0 then
  mode=newslist
else
  mode=cint(mode)
end if
if mode=newslist then
%>

MY NEWSLIST CODE AND SQL

<%
end if
if mode=newsmaker then
%>

MY NEWSMAKER CODE AND SQL AND SAVE CODE FOR THE RECORDES

<%
end if
if mode=singlenews then
%>

MY SINGLENEWS CODE THAT SHOW A SINGLE RECORDS FROM THE DB.

<%
end if
%>

MY /BODY AND /HTML CODE FOR THE END OF MY SITE.

 

is it so or what !??  can someone help me and maybe show me a code for it or an usefull toturials for it !??

sorry my english and HAPPY NEWYEAR !!

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 01 January 2004 at 8:40pm
Not sure why you would wanna do it like that but i would use Case statements like

<%
Select case Request.QueryString("mode")
 CASE "newsmaker"
        'yourcodehere
 CASE "newslist"
        'newslist code here
......
  CASE Else
       'There is no querystring or unrecognized so do what you gotta do
END SELECT
%>
Back to Top
aero View Drop Down
Groupie
Groupie
Avatar

Joined: 21 May 2003
Location: Denmark
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote aero Quote  Post ReplyReply Direct Link To This Post Posted: 01 January 2004 at 9:03pm

why are U not sure why I would do it like that !???

 

Back to Top
TYSON View Drop Down
Groupie
Groupie


Joined: 18 August 2002
Location: Australia
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote TYSON Quote  Post ReplyReply Direct Link To This Post Posted: 01 January 2004 at 11:06pm
Case satements are so much cleaner and easier to manage than a huge IF ..Then block of code.
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 02 January 2004 at 12:00am

Originally posted by TYSON TYSON wrote:

Case satements are so much cleaner and easier to manage than a huge IF ..Then block of code.

run faster too


Lead me not into temptation... I know the short cut, follow me.
Back to Top
aero View Drop Down
Groupie
Groupie
Avatar

Joined: 21 May 2003
Location: Denmark
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote aero Quote  Post ReplyReply Direct Link To This Post Posted: 02 January 2004 at 12:26am
Thanks !!
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 02 January 2004 at 9:57am
Originally posted by aero aero wrote:

why are U not sure why I would do it like that !???

 

The reason I am saying that is that I see so many people trying to cramp a whole project into one page, thus it usually being failry unnecessary.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.