LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 468 users online 173432 members 794 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Video | Dictionary | News | FAQ
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
5 online / 24 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Second Day and I am allready confused
Replies: 7Last Post July 5 4:10am by Zimmy
Single page for this topic Email Print Favorite
( GdFtherOFCOWS )


Pointer Returned Lost Record

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 | 1107 Days Active
Join to learn more about GdFtherOFCOWS Arkansas, United States | Straight Male | 12212 Posts | 24192 Points
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.

-------
Want more of me?  Check out my BLOG.
Share your mp3's for free HERE.


6:42 pm on June 25, 2008 | Joined Mar. 2008 | 105 Days Active
Join to learn more about i who have nothing Ontario, Canada | Straight Male | 2566 Posts | 3280 Points
sakurag


Visionary

Ad Free
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 | 517 Days Active
Join to learn more about sakurag Washington, United States | Straight Male | 2105 Posts | 9369 Points
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 | 4 Days Active
Join to learn more about Zimmy Illinois, United States | Bisexual Male | 9 Posts | 50 Points
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