LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 625 users online 225138 members 879 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
paradise lost
I haven't filled out my profile...
Days Active: 17
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
6 online / 26 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Adding Reply

Quoting Post
Archived Topic: It will not be bumped to the top of the forum.
Topic Second Day and I am allready confused
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
GdFtherOFCOWS Posted at 6:32 pm on June 25, 2008
I don't know how to word this, so if you need clarification, you are out of luck most likely.  They didn't explain it that well to me either.

My task for the time being is to set up a webpage that instead of different pages for different states, instead sets up just one page and loads up the appropriate one for the right state.

So instead of this


walmart.com/default.html <-- Gets info using about which state you are in

wal-mart.com/AL/client.html <--- Sends you each states own page

we want this


walmart.com/default.html  <-- Loads up like normal

walmart.com/defualt.html?state=AL <-- then does this with the state code for the state

walmart.com/setup.html <-- If the state doesn't have a page, or an error occurs, the setup.html loads

I have no idea what the second part is called, and with that, no code examples to work off of.  Any help?

Replies
Zimmy Posted at 4:10 am on July 5, 2008
Your not going to do it in straight HTML.  Period.  You'll need to use PHP, Perl, or ASPX depending on your web server and what it supports.    Best coding stragedy would be a select block with all the potential options for ?state=.  This would be done in a standard "select case", and also allow a generic handler (if it doesn't match any of your specified strings) to lead to an error page and/or the default page.
sakurag Posted at 3:16 pm on June 30, 2008
This really depends on the language you are writing your pages in.  In the simplest terms, you can use some sort of switch method and have the 'default' or 'error' condition send you to the other page.

For extra points, make sure that all errors have a case.  This way, in the future, you do not have to modify the page much to add additional functionality.

i who have nothing Posted at 6:42 pm on June 25, 2008
Umm.  I'm not sure how to do it in JS but in PHP you'd just do

Code:

$state = $_GET['state'];

if ( $state == 'AL' )
{
do this
}
if ( $state == 'something else')
{
do this
}

So yeah.  Just google JS and the GET function.

icecreambar Posted at 6:37 pm on June 25, 2008
Post from this position was omitted due to content violations
iiloveeyouu Posted at 6:34 pm on June 25, 2008
Post from this position was omitted due to content violations
blessedbeaut8 Posted at 6:34 pm on June 25, 2008
Post from this position was omitted due to content violations
smarty Posted at 6:34 pm on June 25, 2008
Post from this position was omitted due to content violations
All 7 previous replies displayed.