LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 504 users online 221753 members 803 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Autumnal
Music: Anything pretty much.
Mood: Sensitive
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
7 online / 18 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Second Day and I am allready confused
Replies: 7Last Post July 5, 2008 4:10am by Zimmy
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( GdFtherOFCOWS )

Swami

Patron
Reply
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?



-------
Transvestites are men who like to eat, drink and be Mary.
Let's do the Time Warp Again!
Hymen Destroyer


6:32 pm on June 25, 2008 | Joined: Mar. 2004 | Days Active: 1,380
Join to learn more about GdFtherOFCOWS Arkansas, United States | Male | Posts: 14,475 | Points: 27,798
LiveWire Humor
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
Post from this position was omitted due to content violations
i who have nothing


Executive

Patron
Reply
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.


6:42 pm on June 25, 2008 | Joined: Mar. 2008 | Days Active: 119
Join to learn more about i who have nothing Ontario, Canada | Straight Male | Posts: 2,559 | Points: 3,473
sakurag


Soothsayer

Patron
Reply
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've got spurs that jingle jangle jingle.
As I go riding merrily along.
And they sing, "Oh, ain't you glad you're single?"
And that song ain't so very far from wrong.


3:16 pm on June 30, 2008 | Joined: Oct. 2002 | Days Active: 853
Join to learn more about sakurag Washington, United States | Straight Male | Posts: 2,734 | Points: 12,101
Zimmy


Grasshopper
Reply
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.

-------
EFNet

4:10 am on July 5, 2008 | Joined: July 2008 | Days Active: 4
Join to learn more about Zimmy Illinois, United States | Bisexual Male | Posts: 8 | Points: 49
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic